Auto import from a "watched folder"

Hello.
Is it possible to have DEVONthink watch a folder and import a file if it is placed in the folder.
I have Hazel doing things to files. I could have Hazel move a file to the watched folder and then import to DEVONthink

It looks likes it automatically importing a file into DEVONthink is possible.
I cannot seem to make it work. I have a Folder Action Setup to monitor a watched folder "DEVONthink - Import & Delete.scpt

When I put a file in the watched folder nothing happens.

Any thoughts. Is there another way to auto import a file?

Thanks Monty

I simply tell Hazel to move the relevant file to the Inbox once Hazel has finished processing it.

Stephen

2 Likes

Folder Actions are a holdover from earlier days (and software versions). The more modern solution (assuming you don’t want to use Hazel) would be to index the folder in question and then use a smart rule to automatically move the contents of the folder to the database. The handbook will tell you more about indexing.

I don’t use the Folder Action Scripts, so can’t provide any helpful support for that method; sorry.

@Stephen_C and @Blanc both have solid suggestions here.

That being said, did you have files in the folder before attaching the folder action?

If so… make sure Folder Actions Dispatcher has Automation privileges for DEVONthink and the Finder in System Preferences > Security & Privacy > Privacy.

I use the InBox folder for this, works well, except the location of the folder introduces some security hoops to jump through. But since is already exists and DT already monitors it, it’s simple and fast to use.

2 Likes

I like this solution! Simple. I can have Hazel do some stuff to the filename etc then move it to the inbox!

Cool
THanks
Monty

1 Like

DEVONthink could do “stuff” to the filename too. Maybe it is an even better solution—just assuming as I don’t know your setup—to have DT index the folder(s) the file with the original name is in and import it from there.

Since DT version 3 I have been using Hazel only for non-DT related files because DT indexing and importing works perfectly.

2 Likes

in case of help to you. DEVONthink and Hazel | Musings on Interesting Things

2 Likes

Here is what U am doing.
Using my iPhone I scan a receipt from a Point of sale
I save it in a specific folder in iCloud.
A typical filename is: “Scan Dec 26, 2021 at 3.00 PM.pdf”
Hazel is monitoring the folder and see the new file.
Hazel looks at the content of the pdf and pulls out the date of the sale
Hazel renames the file to this format: “2021-11-19 Meeting Rent Receipt.pdf”
Hazel then moves the file to DEVONthink inbox in the finder
DEVONthink imports the file
DEVONthink marks the file as read and moves it to the approate folder. “2021”

So. that works. I suspect there is an easier way but…

Monty

2 Likes