Smart Rule Action not running on trigger

I have the following Smart Rule and have tried every combination of trigger (On Import; On Creation; On Moving into Database) but the Action (OCR) still does not trigger automatically. Am I missing something simple?

When exactly should this rule be triggered, meaning after e.g. which user action? Do your documents match the conditions?

I am using the Folder Action Setup to import jpg files into the DT Global Inbox. The files make it into the Inbox and I can select the Smart Rule and it properly picks (highlights) the correct files, but I have to select Apply Rule manually in order for the action to occur. And then it works perfectly. I can’t seem to get a trigger to perform the action automatically.

Scripts don’t trigger smart rules by default unless the script explicitly uses the perform smart rule command which folder actions don’t (due to compatibility to workflows dating back to version 2.x).

Therefore one possibility is to customize the script, another (and the recommended one since version 3) not to use folder actions at all but to index folders and to process the folder’s contents using smart rules.

I guess I need to do more searching and reading. I don’t know how to index folders and run smart rules on folders. Is there a discussion and/or tutorial on how to do this?

Check out the outstanding “DEVONthink Handbook” or same content in Help.


Help > Documentation > In & Out > Importing & Indexing.
Start there and read it thoroughly.

Also smart rules are covered in Windows > Sidebar: Navigate > Smart Ruled, Appendix > Smart Rule Events and Actions, and Automation > Smart Rule Scripts.

Thank you. After much reading, I think I got it now.

Excellent! I always hope I document things clearly enough :slight_smile:

In the help documentation I had to know what I was looking for. I have read about Indexing & Importing before, but I never put 2 + 2 together about Indexing and Smart Rules. The way I finally connected the dots was page 103 of Take Control DEVONthink 3 (1.7) “Import, OCR, and Delete.” Unless you and cgrunenberg hadn’t said “index folders and process the folder’s contents using smart rules”, I would have never connected how to do this from reading the Index Help and the Smart Rules Help. They just didn’t seem connected to me…since I have never seen a need to Index a folder before. But, I think I understand it now.

I had it working for a test, but now it seems to stop after the OCR.

The jpeg files are being copied by Hazel from the ScanSnap Home Folder into the Receipts-Personal folder.

What is the Hazel rule you’re using?
And why are you using Hazel for this?