Background OCR from Applescript?

When I right click on a PDF or an image and select Convert to Searchable PDF, it puts it in the OCR Activity queue.

When I use the convert image applescript command, it seems to do it immediately, and Applescript can timeout. Is there a way I could use applescript to OCR in the background?

That’s not possible. But you could of course use a larger timeout, e.g.


with timeout of 300 seconds
...
end timeout

Darn. Please consider this a feature request. I’ve got a script which automatically splits and crops a bunch of scanned checks, and I’d like them OCRed at the end. But I don’t want to tie up the script while it goes and OCRs 30 pages.

I’ll try UI scripting for now.