The other day I posted an Applescript to OCR documents using PDFPen.
In the comments, awesome DocumentSnap reader Josh requested that it be done as a Hazel rule instead. Given that my love for Hazel is well documented, I am happy to oblige.
I created a folder and then created the following Hazel rule to run against it:
- Extension is PDF
- Date Last Modified is after Date Last Matched (to stop it from trying to re-OCR documents)
Then I asked it to run the following Applescript:
tell application "PDFpen"
open theFile as alias
tell document 1
repeat while performing ocr
close with saving
Of course, if you are using PDFpenPro, replace the first line with “PDFpenPro”.
Here’s a screenshot (unfortunately the bottom of the script is cut off):
Hope this helps out you Hazel and PDFPen fans out there. Enjoy.
Thanks for this Eric. I copied and pasted your script but when I compile the script, I get an error “Expected end of line but found identifier” and the word “ocr” is highlighted at the end of the line that reads “repeat while performing ocr”.
Is something missing from the script?
Thanks in advance.