4 Replies Latest reply on Jan 25, 2009 7:09 AM by Bertus Bolknak

    Export PDF Workflow with Applescript and CS3

    Bertus Bolknak
      Hello,

      I am setting up some PDF workflow with Applescript.

      On a given moment, as my script runs and after getting some user-input answers to questions in some dialogs, my script tells InDesign CS3 to open the Export Adobe PDF window for the current document. I copied and pasted that small part of the script:

      tell application "Adobe InDesign CS3"
      tell document 1
      export format PDF type to "Macintosh_HD:Test01.pdf" using "somePreset" with showing options
      end tell
      end tell

      When you run this small part of my Applescript, InDesign opens the Export Adobe PDF window (as expected) waiting for me to click on "Export". That is exactly what I want, since the user is given here a last opportunity to change some values (for example page range, or spreads). When all is set, the user can click on Export to close the dialog and finish the script.

      Problem: I was hoping that the Adobe PDF Preset "somePreset" would be selected in the first pull-down menu of the Export Adobe PDF window when this window is opened by the script. Unfortunately the last used preset is always selected by default. Anyone suggestions or help?

      Kind regards,
      Bertus Bolknak.
        • 1. Re: Export PDF Workflow with Applescript and CS3
          ksnielsen Level 1
          You could try adding this prior to your tell document statement:

          set theProps to properties of PDF export preset "[Press Quality]"

          Just replace "[Press Quality]" with "somePreset"

          Rather than showing options, I have a dialog box that operators use to set certain things in the export box. The chose they options they want and then I build the preset based on that. Works well. Then they don't have access to everything. Only what I want them to have access to.
          • 2. Re: Export PDF Workflow with Applescript and CS3
            Bertus Bolknak Level 1
            Hello Karen, thank you for your answer.
            Which questions exactly do you ask the operators of your script? Things like page range, color profile (paper type), I guess?
            Do you have just one PDF preset that will be edited by the script only on a few places, based on the answers of the operator?

            Kind regards,
            Bertus Bolknak.
            • 3. Re: Export PDF Workflow with Applescript and CS3
              ksnielsen Level 1
              My operators enter the page range and filename into a dialog box. Then I set those in the script. I use the Press Quality preset to start with and then set the changes I want into a export variable. I set things like bleed, marks, page range, etc.

              Here is an example:

              set theProps to properties of PDF export preset "[Press Quality]"
              try
              delete PDF export preset "Schmidt PDF"
              end try
              set theStyle to {name:"Schmidt PDF", acrobat compatibility:acrobat 7, bleed top:"0.125i", bleed bottom:"0.125i", bleed inside:"0.125i", bleed outside:"0.125i", page marks offset:"0.125i", include ICC profiles:Include None, effective PDF destination profile:use no profile, effective PDF X profile:"No Color Conversion"} & theProps
              make PDF export preset with properties theStyle
              set properties of PDF export preferences to theStyle
              set color bitmap sampling of PDF export preferences to none
              set grayscale bitmap sampling of PDF export preferences to none
              set page range of PDF export preferences to (item i of myPageList) as string
              export document 1 format PDF type to (PrinergyFolder & myJobNumFinal & "_" & VerCode & ".pdf") as Unicode text without showing options

              I am also doing this in Quark.
              • 4. Re: Export PDF Workflow with Applescript and CS3
                Bertus Bolknak Level 1
                Hello Karen, thank you for answer. I think I can script my way through now as far as InDesign is concerned. Despite the fact that we almost never use Quark anymore, I think it's still a good idea to include Quark export in my script as well (just for the cases I need it). I did a lot of InDesign scripting (automatic lay-out with Woodwing plugin and xml), but I never scripted a sigle line for Quark. Do you mind sending me (part of) your script concerning Quark PDF Export?

                I also wonder about the scriptability of Illustrator as far as PDF Export is concerned. The fourth application we use is Freehand (unfortunately discontinued; we used it for almost 20 years ever since version 2.0).

                My final goal is to create a script that guides operators through the process of creating a certtified PDF by asking then a few simple questions.

                Questions I ask them are for example:
                1) Lores or Hires PDF?
                2) Advertisement yes or no?
                3) Papertype 1,2,3,4 or 5
                3) Sheet offset or Rotation (web) offset.
                4) Spotcolors in use yes or no?

                Kind regards,
                Bertus.