首页 文章

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

提问于
浏览
1

我正在使用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 回答

  • 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
    

相关问题