1
votes

I am currently using Adobe Acrobat Pro DC 2015.23 on macOS Sierra. My goal is to create AppleScript that do such things:

  1. Open PDF File
  2. Save this file to pdf-x format
  3. 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:

  1. Open PDF in Adobe Acrobat
  2. Choose PDF Standards Menu
  3. Click (Save as PDF/X)
  4. 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

1 Answers

0
votes

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.