Script to OCR PDFs with the latest FineReader

Thanks for the help …

I got one more question: The filename now looks like “theName.pdf.txt” is there any simpel option to get rid of the old extension?

Use name property, not filename. It’ll return the base name without extention.

Thank You!

Excellent work!

Maybe it would prove useful to new users to link to the most important posts for version 1.1 from the original post at the top? It took me a while to find the code for version 1.1 and your instructions :slight_smile:

I don’t know how to do it…
Forum doesn’t allow me to edit the first post

@Silverstone @roads
Thank you for the smart rule, which works smoothly without any further change, the resulted document is smaller and clearer. At the same time, I am having the same issue, that TEXT can not be selected in the OCRed pdf document. I also follow the steps copying “missing fonts” from …/Supplemental to Library/Font and restart the Mac, but it doesn’t solve the problem in my case.

  • FineReader engine is v.12.1.7
  • macOS Catalina v.10.15.4
  • Devonthink 3.5

Any further suggestion? Thx.

Problem solved. Text of any new OCRed pdf is selectable after the above steps. I was sticking to this OCRed document which was scanned before the above steps.

You are welcome!

How can I make the script just scan the first page of a multi page document?

Well, unfortunately the FR’s function export to pdf does not have such a parameter (to save only selected pages range), so you will need to create a temporary PDF from the first page of a given document and then use the script with it.

For this I’d use frameworks “Foundation” and “Quartz”, like here.

Anyone figured out how to queue invocations of the script?
I made the smart rule triggered on import, and if I scan two items in rapid succession, the smart rule fails on the second one with FineReader being busy.
the error I get is: FineReader got an error: Connection is invalid.

Never mind. I think this was caused by the rule trying to do stuff (set a tag) on the document after the script ran.
I still sometimes have the old document not deleted, which is strange.

Hi @Silverstone, I’ve been using your script for some time now, but since getting a new M1 Mac and upgrading to the latest version of FineReader, the script no longer works. I doubled checked the usual suspects from the posts above, but am consistently getting the following error:

“ABBYY FineReader PDF got an error: Can’t continue «event FR 118».”

I see the event in the script, but can’t understand what it means. Have you by chance updated this script for the latest version of FineReader? Any help would sure be appreciated as the was such a great script!

Darryl

Hey, Darryl

New ABBYY Finereader PDF app is not yet scriptable, unfortunately… They did say, they are going to make it AppleScriptable but not yet (

You may want to use previous version of the app with the script

Hi @Silverstone, thanks for taking the time to reply. That is unfortunate indeed. Thanks for clarifying this for me.