Script OCR Without Using Automator

Is there a way to directly script OCR without using OCR items in Automator?

I’ve been trying out OCR programs to process a big bunch of historical documents I’ve collected and DTPO comes out on tops so far. However, I’d like to automate the process in code without fiddling around with Automator.

OCR is indeed scriptable, see OCR Commands Suite of DEVONthink Pro Office. The “ocr” command processes a file which is OCRed & imported, the “convert image” command processes an existing image/PDF record of the database and creates a new, OCRed record.

As an example, if you have the DEVONthink add on “Folder Action Scripts” installed (from the DEVONthink > Install Add-Ons… menu), then navigate to ~/Library/Scripts/Folder Action Scripts and study the script “DEVONthink - Import, OCR & Delete.scpt”. This is a folder action script, which might not be what you want, but you’ll see in the code the OCR techniques that Christian mentioned.