2

The latest version of ABBYY FineReader for OS X now supports AppleScript. I try to write a simple script that does an OCR of a given pdf document and saves it as a pdf document to make it searchable. Unfortunately, I'm a beginner in AppleScript and can't get it to work. I couldn't find further documentation or samples for scripting ABBYY FineReader.

I managed to open the dictionary of FineReader, it has this function:

export to pdf v : Converts the current document to a PDF file. If FineReader is running in a Sandbox, the file will be saved to a temporary directory.
export to pdf file : NO_DESCRIPTION
    [ocr languages enum language list type] : List of recognition languages that includes     language identifiers and full language names.
    [saving type save settings enum] : Specifies file creation settings for saving results.
    [export mode pdf layout] : Specifies export mode.
    [keep page numbers headers and footers boolean] : Keeps headers, footers and page numbers.
    [page size page size enum] : Specifies paper size.
    [keep pictures boolean] : Keeps pictures in recognized document.
    [image quality image quality enum] : Specifies quality of pictures in output file.
    [keep text and background colors boolean] : Keeps background and character colors.
    [use mrc boolean] : Compresses the output file significantly while retaining high quality of text and images.
    [make pdfa boolean] : Creates a searchable PDF document that is well suited for archiving.
    [create outline boolean] : Creates a table of contents in a PDF file based on headings.
    [enable pdf tagging boolean] : Enables PDF tags.
    [embed fonts boolean] : Embeds fonts from the document in the e-book.
    → file :

I tried this script:

tell application "FineReader OCR Pro"
    export to pdf "<path to pdf>"
end tell

However, I get the output "missing value". What is wrong?

Markus
  • 436
  • 3
  • 13
  • I got a reply from Abbyy Support. Find it here: http://macscripter.net/viewtopic.php?pid=178759#p178759. Once I got a working solution, I'll post it here. – Markus Feb 18 '15 at 17:09

1 Answers1

1

Looks like you may need to supply a path to save the pdf to.

Try this:

tell application "FineReader OCR Pro"
    export to pdf ((path to desktop) as string) & "test-export.pdf"
end tell

Should save file to your desktop

adamh
  • 3,222
  • 1
  • 20
  • 16
  • Well, I got it working now if I load the input file to OCR via the user interface before I start the script. But I cannot figure out how to load the – Markus Jan 14 '15 at 07:23