Smart rule on importing

Hello, I’m setting up my new DT3 and now I have this folder in finder with a folder action that imports new doc’s into my DT3. In DT3 I would like to apply a smart rule that adds a tag to incoming doc’s depending on content features. Now, apparently the option ‘perform the following actions on’ IMPORT doesn’t work by an imported doc initiated by a folder action. It only seems to work when I manually import the doc. Is there a workaround ?

Development would have to assess this, but you can set the event trigger to Hourly.

Scripts (including folder actions) don’t trigger smart rules and probably never will as the result of these scripts/actions has to be predictable and as smart rules can perform scripts too. A scheduled smart rule might be an alternative.

Also, I suggest not using the folder action.

Just index the folder into your database and target it with the smart rule. Here is an example smart rule, targeting an indexed group from a folder on my Desktop

And the results…


PS: This is an example showing something that could be done, i.e., filing the images in groups per extension. It may not be useful to everyone, but the point is to teach something too. :slight_smile:

I can’t find the Script “Move into Database” ?

The script isn’t included in the latest version any longer, the new action “Move into database” is recommended instead.

OK, thanks. Is there a way to save an attachment of an imported email to the disk (outside of DT) through such a script?

Such a script isn’t available yet.

But this script might be useful:

1 Like

Overlooked this suggestion in September, but could this replace the folder action scripts?

The latter seem to have a tendency to quit working on shared network folders after a macOS reboot.

Yes, there are certainly instances where a smart rule can replace a DEVONthink folder action.
Here is a smart rule example I sent to a customer today that supplants the Import, OCR & Delete folder action…

The To OCR folder is indexed from my Desktop and detects dropped images or PDFs with no text.
It also moves the OCR’d file to a different location to avoid reprocessing, similar to what a folder action does.

OK, I’ve tried indexing a network folder that is mounted in macOS. It sort of works, but needs some sanding around rough edges.

If I add the folder, the file is processed as expected. However after reboot DT doesn’t seem to find any files in the same network folder anymore. The network folder and test file are visible in macOS finder.

EDIT: it seems indexing network folders isn’t supported: Apparently network shares can be indexed.

You should only index local data, e.g., on the local hard drive or connected drives. DEVONthink doesn’t support indexing data that resides only in the cloud.

Which might explain might I can add the same network folder twice, after which DT finds the indexed file in one, but not in the other.

EDIT: most likely problems indexing a network share are due to latency issues, e.g. slow WiFi connections.

I’ll try and automate with Hazel as a workaround.

I’ve also added “Move into database”, as your rule seemed to create a loop of imports.

I have implemented this style of smart rule, monitoring an indexed folder for new files, but it does not trigger reliably. Under what scenarios does ‘On Import’ trigger for an indexed folder ?

It should actually be always triggered when new items are added to the folder (e.g. in the Finder). Which folder did you index?


I am indexing a local folder on the desktop, which is shared with a VMWare Fusion guest virtual machine running OSX-Sierra and 32bit ScanSnap Manager. Problem was when ScanSnap Manager was creating PDFs directly in the shared folder. The solution is for ScanSnap Manager to save PDFs to a local folder in the guest OS, and then use Hazel to move the file to the shared folder once ScanSnap has finished creating the file.

All working :smile:

How do you get the second line “any of the following are true” ?

option-click on the + symbol (which turns into … as soon as you depress the option-key)

Thank you!

1 Like