2011-08-18 6 views
1

私はScanSnap S1500Mを使用してすべての紙文書をフォルダ/ PDF-scansにスキャンしています - Adob​​e Acrobat X ProfessionalテキストをOCRする。ApplescriptまたはAutomator:Acrobat X Proを実行して複数のPDFファイルをバッチ処理する

私は(毎日)このプロセスを自動化したいと思います:

  • オープンのAcrobat X
  • ProのバッチOCR処理のPDFファイルをに/ PDF-スキャン/、
  • をfilenameに "-OCR" を追加
  • OCR後、

私はAutomatorのを使用すべき//PDF-スキャンで元のPDFファイルを削除/ PDF-OCR/

  • にファイルを移動?これを行うことができるスクリプトはありますか?それはiCalの繰り返しイベントに結びついている必要がありますか?

    ありがとうございます。

  • +0

    あなたはあなただけのalleの必要なアクションを処理するAppleScriptで...到着し、すべての新しいファイルのためのあなたのAppleScriptを呼び出すためのAutomatorを言うことができる...アドビアプリケーションを持っていますAppleScriptで、さらにはjavascriptでスクリプト化できます。 – Yahia

    +0

    @ Yahia:それは完全に真実ではありません。 AcrobatはAppleScriptでほとんどスクリプト化できず、AdobeはすべてのAPI開発をJavascriptにプッシュしています。また、Automatorは必須ではありません。 Applescriptは、アプリケーション内で適切に実装されている場合、これらのすべてのタスクをうまく処理できます。私はここでJavascriptの機能を話すことはできません。 –

    答えて

    1

    私はPDFPenをダウンロードして、簡単に文書を読むことができます。あなたは、このスクリプトを使用することができることをやったら:

    set the PDF_folder to "where:Ever:Your:PDF:folder:is:" as alias 
    set the OCR_folder to "/where/ever/you/want/the/new/folder/to/be" as POSIX file 
    
    tell application "Finder" 
        repeat with this_PDF in (every item of the PDF_folder) 
         my ocr(this_PDF) 
        end repeat 
    end tell 
    
    on ocr(this_PDF) 
        tell application "PDFpen" 
         open this_PDF as alias 
         tell document 1 
          ocr --simple 
          repeat while performing ocr 
           delay 1 
          end repeat 
          delay 1 
         end tell 
         set this_PDF to (save document 1 in this_PDF) 
         close document 1 
        end tell 
        tell application "Finder" 
         if not exists OCR_folder then set the OCR_folder to (make new folder at (the OCR_folder as alias with properties {name:"ocr"}) 
         move this_PDF to the OCR_folder with replacing 
        end tell 
    end ocr