Nick,

Below I will paste a copy of the AppleScript that I use in a Hazel rule that 
will open a pdf, check to see if it needs to be OCR'd, OCR it if necessary and 
then move it to another folder to be sorted by other requirements.

In PDFPen Pro you can set the preferences to OCR upon opening. I have disabled 
this as I let my script handle it.

Anyway here is the script and if you have any problems feel free to ask.

Keith

-- Start AppleScript --

set myFile to POSIX path of theFile
set theResult to do shell script "grep -i 'encoding' " & quoted form of myFile 
& " &>/dev/null && echo 1 || echo 0"
if theResult is "0" then
        tell application "PDFpenPro"
                open theFile as alias
                tell document 1
                        ocr
                        repeat while performing ocr
                                delay 1
                        end repeat
                        delay 1
                        
                        close with saving
                end tell
                do shell script "afplay ~/Documents/Sounds/itisdone.wav &"
                tell application "PDFpenPro"
                        quit
                end tell
        end tell
else
        do shell script "afplay ~/Documents/Sounds/dontouch.wav &"
end if
-- End AppleScript ---

On Mar 11, 2014, at 11:41 PM, Nicholas Parsons <mr.nicholas.pars...@gmail.com> 
wrote:

> HI list,
> 
> I get tens if not hundreds of scanned documents at work which have not been 
> OCR-ed. I've been trialling a number of OCR programs recently. I've been 
> really impressed with ABBYY Fine Reader, which seems to produce much better 
> results than Prizmo or even Docuscan Plus. However, manually converting each 
> document takes far too much of my time.
> 
> I've heard much in the mainstream media, particularly from the Mac Power 
> Users podcast, about automating the OCR process. They use PDFPen, Apple 
> Script and Hazel to automatically OCR things. However, I just tried to OCR a 
> document with PDFPen Pro and couldn't even do it manually. The OCR Document 
> button was greyed out, and forcing it with command-option keys didn't seem to 
> work.
> 
> So, does anyone else have any ideas for how to automate the OCR process? 
> Ideally using ABBYY Fine Reader as that seems to be the most accurate engine 
> I've tested.
> 
> Many thanks for any ideas.
> 
> Cheers,
> Nic
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "MacVisionaries" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to macvisionaries+unsubscr...@googlegroups.com.
> To post to this group, send email to macvisionaries@googlegroups.com.
> Visit this group at http://groups.google.com/group/macvisionaries.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to macvisionaries+unsubscr...@googlegroups.com.
To post to this group, send email to macvisionaries@googlegroups.com.
Visit this group at http://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/d/optout.

Reply via email to