Hazel OCR script in Nitro PDF Pro - does it currently work?

Is the OCR script (Katie Floyd’s / Rosemary Orchard’s) still working for people in Nitro PDF Pro?

If I recall correctly, Nitro PDF Pro may have changed the way it OCRs PDFs. I think in the past, on opening the PDF the app would start OCRing. Now there’s an extra step required: 1 option is File > OCR.

When that changed, my Hazel script stopped doing the OCR step.

Any suggestions?

The script I have (and I don’t recall where it came from) “kind of” works. The script will open the file and will OCR and give me the tone indicating that the OCR is complete; however, the app still thinks the file is un-ocr’d. So, it leaves a dialog box open asking me whether I want to OCR it. If I decline the OCR, close the file, and re-open it, the file was definitely ocr’d. What It used to do is open, OCR, then close the file and the app. I’m not sure how to get that functionality back.

Hi @iPersuade,

Your reply was very helpful!

Because of your reply, I looked further into my issue and saw that Nitro PDF Pro is doing a good job OCRing a scanned PDF. My problem was that for the PDFs I was using to test the macro: Nitro didn’t view those particular PDFs as scanned documents. But I’m having no problem with the Hazel rule with other types of PDFs.

If your Macro is viewing an OCRed file as not OCRed, I recommend you check Rosemary Orchard’s post in talk.automators.fm which has the full macro.

1 Like

I just replied to this in an almost identical thread.

If your OCR script has “get the needs ocr of document 1” in it, it seems that no longer works. comment out the line and change the next line to “if true then”.
It’s not a perfect fix since it will ocr previously ocred documents, but that is what an older script did.

The older script:

tell application "PDFpenPro"
	open theFile as alias
	tell document 1
		repeat while performing ocr
			delay 1
		end repeat
		delay 1
		close with saving
	end tell
	tell application "PDFpenPro"
	end tell
end tell

Of course replace PDFpenPro with Nitro PDF Pro to use the Nitro version.

This was the problem that was in my script. Removing it fixed the script. I’m going to check with Nitro to see if there is a scripting dictionary to determine if there is a replacement for “get the needs…”

Thanks for this, @tomalmy.

Wow, thanks @tomalmy
I followed your directions and now Nitro PDF Pro is OCRing even the PDFs that the previous rule choked on.