Folder Action import from Dropbox

Hey everyone,

after using a ScanSnap ix500 for quite some years I just got myself a shiny new ix1600 with the intent to keep out the computer at scantime and directly scan to the cloud and later import into DevonThink. Scanning and moving stuff to the dropbox works just fine. I found out that the right way to auto import into Devonthink from a folder would be folder action scripts. I never used them before but that basically sounds easy. Script is installed and activated. Whenever a new file arrives Devonthink instantly opens but then nothing happens. I used the Import & Delete example script and by looking at it, it doesn’t look like I need to change anything on the script.

Maybe I’m just missing something… here’s the script I’m using:

-- DEVONthink - Import & Delete.applescript
-- Created by Christian Grunenberg on Fri Mar 26 2010.
-- Copyright (c) 2010-2014. All rights reserved.

on adding folder items to this_folder after receiving added_items
	try
		if (count of added_items) is greater than 0 then
			tell application id "DNtp" to launch
			repeat with theItem in added_items
				try
					set thePath to theItem as text
					if thePath does not end with ".download:" and thePath does not end with ".crdownload:" then
						tell application id "DNtp"
							set theRecord to import thePath to incoming group
							if exists theRecord then tell application "Finder" to delete theItem
						end tell
					end if
				end try
			end repeat
		end if
	end try
end adding folder items to

I’m on Devonthink 3.8

Cheers,
Frank

Congratulations on the new scanner! :smiley:

I found out that the right way to auto import into Devonthink from a folder would be folder action scripts.

Actually, that’s old tech (and possibly you may be having an issue with macOS’ Automation options in Systemp Preferences > Security & Privacy).

Instead of using a folder, have you considered indexing that scanning destination folder in Dropbox then using DEVONthink’s smart rules to file the item?

Are you intending to keep the files in the Dropbox folder in the Finder?

I can vouch for the Indexed folder on Dropbox with a smart rule to process.
I frequently use other computers with nothing on them but production software and highly mediated internet connections.(Bespoke VPN, firewalls etc). The ubiquity of Dropbox for file transfer means that I can usually get IT departments to let me into the web interface of Dropbox on those machines. I have two Dropbox folders for two different databases that are indexed in DT and anything put in those folders is imported and tagged as New Import.
When I see my DevonThink installs on my own computers, a smart group of New Import is right there to show me what I added.

3 Likes

No, i just didn’t know about that. I basically have used Devonthink as a big scan/archive/search engine without doing a whole lot sorting. The OCR is good enough for me so I do find everything I need later. Guess I need to dig a bit deeper for that. So far I have done this all locally on one machine. I want to keep this more independent from one machine with the new scanner - hence the dropbox way.

No, they should just move into the DT database and be deleted from that Dropbox folder.

Here’s an example smart rule…

  • It targets an indexed Finder folder files needing OCR would be put into.
  • It checks for a specific tag (this is optional).
  • It looks for images or PDFs with no words.

On import, i.e., when you drop a file into the folder and DEVONthink detects it…

  • The file is moved into the database. This is an import and removes the file from the Finder folder. No cleanup needed!
  • Does OCR on the file. The Apply option doesn’t genetate a new file. Again, no cleanup needed.
  • Tags the file (still optional)
  • Moves the file into a destination group.

Here is the smart rule if you’d like to mess with it…
Import from Finder, OCR, and File.dtSmartRule.zip (1010 Bytes)

1 Like

Newbi question:

  1. Why is “indexed Finder folder” important (and what is it)?
  2. How do I create such an indexed folder?

Thanks so much