如何使用 AppleScript 和 Acrobat Pro 从 PDF 中自动提取页面?
我是 AppleScript 的新手,但我正在尝试创建一个脚本,该脚本将遍历文件夹中的所有 PDF,将页面提取到单独的文件中.我的计划是结合使用 Automator 和 AppleScript.
I'm new to AppleScript, but I am trying to create a script that will go through all PDFs in a folder extracting the pages into separate files. My plan is to use a combination of Automator and AppleScript.
到目前为止,我的 AppleScript 是:
My AppleScript so far is:
tell application "Adobe Acrobat Pro"
open theFile
set numPages to (count active doc each page)
--execute the extraction here
end tell
Acrobat Pro 中的命令位于 Options >提取页面...
,我可以在其中指定页面范围并提取到单独的文件.但是,我似乎找不到使用 AppleScript 中的 Acrobat Pro 词典来执行此操作的方法.
The command in Acrobat Pro is under Options > Extract Pages...
, where I can specify the page range and to extract to separate files. However, I can't seem to find a way to do this with the Acrobat Pro Dictionary in AppleScript.
有一个执行菜单项的 execute
命令,但我似乎无法让它工作(我也不确定要使用的语法;即 execute "选项:提取页面..."
?).对此有什么帮助吗?
There is an execute
command that executes a menu item, but I can't seem to get it working (I'm also not sure of the syntax to use; i.e. execute "Options:Extract Pages..."
?). Any help on this?
我认为您可以完全使用 Automator 完成此操作,而无需 AppleScript 或 Adobe 软件.PDF 到图像"操作将多页 .PDF 文件拆分为单独的 .PDF 文件,每页一个:
I think you can do this entirely with the Automator without the need for AppleScript or Adobe software. The "PDF to Images" action splits a multi-page .PDF file into individual .PDF files, one per page: