3 Replies Latest reply on Nov 12, 2009 2:47 PM by [Jongware]

    Script that worked in CS does not work in CS4 - multiple open page, print , pdf export and close

    Dawid_Ruzicka

      I had a script that worked great for me in Indesign CS. But now does not work in CS4. Anyone knows what needs to be done to make it work again ?

       

      When I drop folder with indesign files on top of this script:

      1. opens first page

      2. turns specific layer on

      3. prints using preset

      4. exports using preset

      5. close without saving

      6. next page

       

      Anyone who can give me solution or idea how this should work is greatly appreciated.

       

      on open sourceFolders

      repeat with sourceFolder in sourceFolders

      tell application "Finder"

      try

      -- If you would like to include subfolders, you say - every file of entire contents of folder…

      set idFiles to (every file of folder sourceFolder whose file type is "IDd5") as alias list

      on error -- work around bug if there is only one file

      set idFiles to (every file of folder sourceFolder whose file type is "IDd5") as alias as list

      end try

      end tell

       

      if idFiles is not {} then

      tell application "Adobe InDesign CS4"

      set user interaction level to never interact

      repeat with i from 1 to count of idFiles

      open item i of idFiles

      tell document 1

      try

      set visible of layer "ImagesTag_Layer" to true

      end try


      set myPreset to "letter size" -- name of print style to use

      with timeout of 700 seconds

      print using myPreset without print dialog

      end timeout

      set myPreset1 to "pdf preset name" -- name of pdf export style to use

       

      set myName to the name -- name includes .indd should remove at some point          

      with timeout of 700 seconds

      export format PDF type to "users:temp:Desktop:pdf:" & myName & ".pdf" using myPreset1 without showing options -- set path here format ComputerName:Folder1:Folder2:......:FileName.pdf

      end timeout

      close without saving

       

      end tell

      end repeat

      set user interaction level to interact with all

      end tell

      end if

      return 10 -- try again in 10 seconds

      end repeat

      end open