AppleScript for DevonThink Smart Rule

I need a simple to run in a smart rule. I want to have the latest file added to DevonThink inbox to be ocr’d and then moved to a desktop folder on my mbp (not a DevonThink database folder).

I meant an AppleScript to run in a smart rule

I believe that can be done with a smart rule alone, not needing a script. See the action “apply OCR”, “export” and “move” (to trash)

Is this meant to actually be…

  • moved, i.e., no longer part of your database
  • copied but separate from the document in your database
  • indexed so it’s in an external location in the Finder but is accessible, searchable, etc. within the database

?

Moved would work fine

I don’t understand your reply. Just using a smart rule there is no option to move to folder on my MBP desktop under either move or export as the action. I don’t want to move the file to DevonThink trash.

The easiest solution without AppleScript is a smart rule that is performed On Importing. But first you would have to index the destination folder. Then these actions are sufficient:

  • OCR > Apply
  • Move

The Move action uses the just indexed folder.

I was thinking of “Move to External Folder”

Which apparently only works for indexed folders. That’s what @cgrunenberg suggested, too. But if you don’t like that, you can of course use the scripting method export, which doesn’t seem to need an indexed folder.

Actually the Move command (the one suggested by me) is sufficient in this case. Moving an item to an indexed group automatically moves it to the external folder since version 3 (assuming the external folder is accessible).

So, is „move to external folder“ just something left over from an earlier version?

1 Like

It’s available for e.g.

  • Databases dating back to version 2.x
  • After moving items while the indexed group was not available (e.g. on an unmounted network volume)
  • If automatic moving is disabled via a hidden preference
  • After moving items into the database

The key was making the folder I want to move to an indexed folder. Once I did that everything works as I wanted. Thank you to those of you who replied.

PS: the same or similar process is described here…