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
ocr
repeat while performing ocr
delay 1
end repeat
delay 1
close with saving
end tell
end tell
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.