问题
I am currently using Adobe Acrobat Pro DC 2015.23 on macOS Sierra. My goal is to create AppleScript that do such things:
- Open PDF File
- Save this file to pdf-x format
- Close file
I create AppleScript, that do all steps, but i can't find any documentation how to choose with PDF standard to use while saving.
If I want to do this manually I do following steps:
- Open PDF in Adobe Acrobat
- Choose PDF Standards Menu
- Click (Save as PDF/X)
- Press save
The question is how to set PDF/X standard while saving.
My script
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set theFiles to choose file with prompt "Select the files" of type {"pdf"} with multiple selections allowed
set aaRunning to is_running("Adobe Acrobat")
tell application "Adobe Acrobat"
repeat with theFile in theFiles
open theFile without dialogs
save active doc to theFile
close active doc
end repeat
if not aaRunning then
quit
end if
end tell
回答1:
As you may have noted, Applescript support of Acrobat is very limited.
Just so, the following possible workflows come to my mind:
a) you can use Preflight Profiles to create PDF/X (this is also the engine if you do it manually). You can run/apply Preflight Profiles using Acrobat JavaScript, and you can run Acrobat JavaScripts using the do script
Applscript command.
b) you create a Preflight Droplet which makes an according PDF/X file. You then can use Applescript to open the document (file) in that droplet.
c) you use System Events to control the user interface elements of Acrobat. In other words, you do what you would do manually, but using System Events. You may want to use an utility, such as UI Browser to find the ways to address the various dialog elements.
来源:https://stackoverflow.com/questions/41714452/applescript-to-save-pdf-as-pdf-x-in-acrobat