Applescript或Automator:运行Acrobat X Pro批量处理OCR多个PDF文件,等等

时间:2011-08-18 07:07:57

标签: pdf applescript ocr acrobat automator

我正在使用ScanSnap S1500M将所有纸质文档扫描到文件夹/ PDF扫描/ - 我想使用Adobe Acrobat X Professional来OCR文本。

我想自动化这个过程(每天):

  • 打开Acrobat X Pro
  • 批量OCR处理/ PDF-scans /中的PDF文件,将“-OCR”附加到文件名
  • 在OCR之后,将文件移动到/ PDF-ocr /
  • 删除/ PDF-scans /
  • 中的原始PDF文件

我应该使用Automator吗?有脚本可以做到这一点吗?它是否必须与iCal的重复事件挂钩?

谢谢。

1 个答案:

答案 0 :(得分: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