【问题标题】:Applescript or Automator: Run Acrobat X Pro to batch OCR multiple PDF files, moreApplescript 或 Automator:运行 Acrobat X Pro 以批量 OCR 多个 PDF 文件等
【发布时间】:2011-08-18 07:07:57
【问题描述】:

我正在使用 ScanSnap S1500M 将所有纸质文档扫描到文件夹 /PDF-scans/ - 我想使用 Adob​​e Acrobat X Professional 对文本进行 OCR。

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

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

我应该使用 Automator 吗?有没有可以做到这一点的脚本?它必须与 iCal 的重复事件相关联吗?

谢谢。

【问题讨论】:

  • 您可以告诉 automator 为每个到达的新文件调用您的 AppleScript... 在 AppleScript 中您只需处理所有必要的操作... Adob​​e 应用程序可以通过 AppleScript 甚至 javascript 编写脚本...
  • @Yahia:这并不完全正确。 Acrobat 只能用 Applescript 编写脚本,而 Adob​​e 已将所有 API 开发推向 Javascript。此外,不需要 Automator;当 Applescript 在应用程序中正确实施时,它可以巧妙地处理所有这些任务。我不能在这里谈论 Javascript 的功能。

标签: pdf applescript ocr acrobat automator


【解决方案1】:

我会下载PDFPen,它可以让您轻松地对文档进行 ocr。完成后,您可以使用此脚本:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-12
    • 2014-10-29
    • 2017-06-02
    • 1970-01-01
    • 1970-01-01
    • 2013-09-09
    • 1970-01-01
    • 2011-01-23
    相关资源
    最近更新 更多