In order to see if a file has been OCR’d with the DT’s ABBY Fine Reader Engine outside DT I let Hazel put automatically put a label on the file, if it has been OCR’d with the ABBY Engine.
Now that my files are in DT I would like to know if there is a way to let Hazel or DT or Automator or whatever…, put automatically a tag within DT if the file matches some determined condition (for example: OCR’ed with Abby, that is to say, it meats the condition: “Content Creator starts with DEVONthink Pro Office”).
Parts of the “outside-DevonThink” Hazel automation-structure and script(s) to be found here, especially Step 2, may be helpful to you. The AppleScript that identifies previously OCR’d PDFs looks interesting. But please note that I’m an AppleScript tyro, I cannot vouch for the functionality of the scripts, they are nearly two years old and there are amendments further down the thread.
This script will create a tag for each selected document that contains the contents of that document’s kMDItemCreator metadata – if such an element exists for that document. (I.e., it will fail silently for most documents that are not PDF or PDF+Text)
tell application id "DNtp"
set theSelection to the selection as list
repeat with thisItem in theSelection
set myMD to the meta data of thisItem
try
set theCreator to (kMDItemCreator of myMD) as string
set the tags of thisItem to the tags of thisItem & theCreator
end try
end repeat
end tell
Use this by selecting multiple documents (do not select groups) and running the script. Instructions for using scripts are found in the manual, Help, and all over the internet.
If you run this against a passel of PDFs and then look at your tags you’ll see which ones came from which creator.