2015-01-09 96 views
2

最新版本的ABBYY FineReader for OS X現在支持AppleScript。我嘗試編寫一個簡單的腳本來執行給定pdf文檔的OCR並將其保存爲pdf文檔以使其可搜索。不幸的是,我是AppleScript的初學者,無法使其工作。我找不到腳本ABBYY FineReader的其他文檔或示例。用AppleScript腳本編寫ABBYY FineReader

我設法打開FineReader的字典,它有這個功能:

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 : 

我想這個腳本:

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

不過,我得到的輸出 「缺失值」。哪裏不對?

+0

我從ABBYY技術支持的答覆。在這裏找到它:http://macscripter.net/viewtopic.php?pid=178759#p178759。一旦我找到了工作解決方案,我會在這裏發佈。 – Markus 2015-02-18 17:09:47

回答

1

看起來你可能需要提供一個路徑來保存pdf。

試試這個:

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

應該保存文件到您的桌面

+0

嗯,如果我在啓動腳本之前通過用戶界面將輸入文件加載到OCR,我現在就可以工作了。但我無法弄清楚如何加載 – Markus 2015-01-14 07:23:45