0 Replies Latest reply on Aug 21, 2009 10:54 AM by Debbie Perotta

    AppleScript print issue

    Debbie Perotta

      Version:1.0 StartHTML:0000000149 EndHTML:0000001120 StartFragment:0000000199 EndFragment:0000001086 StartSelection:0000000199 EndSelection:0000001086


      Below is an AppleScript that we have been using for several years that goes through a whole folder and prints each file.

      To create press-ready PDFs we send the .ps files generated by InDesign CS2 to Acrobat Distiller.

      Just this week we have had an issue that when we use the script, random in-line graphics drop out of the PDF. When we process the same files using the same print preset, but open each manually and print without the use of the script, these in-line graphics are in the PDF.

      Have you heard of this issue with printing using AppleScript before?

      Any insight you can give me will help tremendously.

      We are researching moving to CS4 in 2010, but in the meantime we have CS2 to continue with.

      We use primarily MAC OS X 10.4.11.

      We've checked the layer. They are not on any layer the script is turning off.




      set x to 1


      tell application "Finder"
          --set fileName to choose folder with prompt ¬
          --    "Select folder to output to"
          set myFolder to choose folder with prompt ¬
              "Select folder to process"
          set myFiles to every file of myFolder
          repeat with x in myFiles
              set file_type to the (the creator type of x)
              --display dialog file_type
              if ((the creator type of x) = "InDn") then
                  -- open x
                  set fileName to the name of x as string
                  set oldDelim to AppleScript's text item delimiters
                  set AppleScript's text item delimiters to "."
                  set fileName to text item 1 of fileName
                  -- display dialog fileName
                  set AppleScript's text item delimiters to oldDelim
                  tell application "Adobe InDesign CS2"
                      open x
                      set myDoc to active document
                      tell print preferences of myDoc
                          set page range to all pages
                          set print spreads to false
                          set print master pages to false
                      end tell
                      -- change to correct target folder
                      set printFile to ("Mesa_Volume:MakePDF_Folder:ELS_PressReady:In:" & fileName & ".ps") as string
                      -- change to correct print preset
                      set myPreset to printer preset "Buck Final PDF"
                      tell myPreset
                          set print file to printFile
                      end tell
                      tell myDoc
                          -- the following will hide the layers IDLayer and proof slug--dp June 11, 2008
                          if exists layer "IDLayer" then
                              --display dialog "layer IDLayer exists"
                              set IDLayer to layer "IDLayer"
                              set properties of IDLayer to {visible:false}
                          end if
                          if exists layer "proof slug" then
                              --display dialog "layer proof slug exists"
                              set proofSlug to layer "proof slug"
                              set properties of proofSlug to {visible:false}
                          end if
                          if exists layer "Figure Mention Layer" then
                              --display dialog "layer proof slug exists"
                              set figMentionLayer to layer "Figure Mention Layer"
                              set properties of figMentionLayer to {visible:false}
                          end if
                          delay 2
                          with timeout of 1200 seconds
                              print using myPreset without print dialog
                          end timeout
                          delay 2
                          with timeout of 600 seconds
                              close myDoc saving no
                          end timeout
                      end tell
                  end tell
                  delay 2
              end if
          end repeat
      end tell