2 Replies Latest reply on Mar 21, 2008 10:11 AM by Ads-R-Us

    My batch print script won't work in CS3

    Ads-R-Us Level 1
      I've just recently upgraded to CS3. Now when I try to run my BatchPrintScript. It's returning an error.
      I suspect the scripting language may have changed a bit between versions.
      The error reads:
      AppleScript Error!
      Error Number: - 10006
      Error String: Adobe InDesign CS3 got an error: Can't set user interaction level to never interact

      Here's the script as copied from ScriptEditor:
      ttell application "Adobe InDesign CS3"
      activate
      --retreive list of printer presets
      set myLabelWidth to 100
      set myDialog to make dialog with properties {name:"Print Presets"}
      tell myDialog
      tell (make dialog column)
      tell (make border panel)
      tell (make dialog column)
      tell (make dialog row)
      tell (make dialog column)
      make static text with properties {static label:"Choose Preset:", min width:myLabelWidth}
      end tell
      tell (make dialog column)
      set myLabelsButtons to make radiobutton group
      tell myLabelsButtons
      set PresetList to name of every printer preset of application "Adobe InDesign CS3"
      repeat with myButton in PresetList
      make radiobutton control with properties {static label:myButton, checked state:false}
      end repeat
      end tell
      end tell
      end tell
      end tell
      end tell
      end tell
      end tell
      set myResult to show myDialog
      if myResult = true then
      set x to selected button of myLabelsButtons
      set myButtton to x + 1
      set myPreset to item myButtton of PresetList
      end if
      destroy myDialog
      end tell

      tell application "Finder"
      activate
      set thefolder to choose folder with prompt "Select a Folder with InDesign Files to be Printed" as text
      set thePath to thefolder as text
      set the selected_items to every item of folder thefolder
      if the selected_items is {} then
      beep
      display dialog "Please select a folder with InDesign files before running this script." buttons {"Cancel"} default button 1
      end if
      repeat with aFile in selected_items
      --this gets just the ID files
      if class of aFile is document file and creator type of aFile is "InDn" then
      tell application "Adobe InDesign CS3"
      activate
      with timeout of 600 seconds
      set user interaction level to never interact
      open aFile
      tell document 1
      tell print preferences
      set active printer preset to myPreset
      set page range to all pages
      end tell
      print without print dialog
      close saving no
      end tell
      end timeout
      --might need this delay
      --delay 10
      set user interaction level to interact with all
      end tell
      end if
      end repeat
      end tell

      - It may help to know that I have this script in a folder named "Vesrion 5.0 Scripts"
      because I took it out of a folder named "Version 4.0 Scripts" when I was using it in CS2

      Chris
        • 1. Re: My batch print script won't work in CS3
          Kasyan Servetsky Level 5
          Hi Chris,
          User interaction level is property of script preferences object in CS3, so it should be:
          set user interaction level of script preferences to never interact
          set user interaction level of script preferences to interact with all
          -------------------------------------------------------------------
          tell application "Adobe InDesign CS3"
          activate
          --retreive list of printer presets
          set myLabelWidth to 100
          set myDialog to make dialog with properties {name:"Print Presets"}
          tell myDialog
          tell (make dialog column)
          tell (make border panel)
          tell (make dialog column)
          tell (make dialog row)
          tell (make dialog column)
          make static text with properties {static label:"Choose Preset:", min width:myLabelWidth}
          end tell
          tell (make dialog column)
          set myLabelsButtons to make radiobutton group
          tell myLabelsButtons
          set PresetList to name of every printer preset of application "Adobe InDesign CS3"
          repeat with myButton in PresetList
          make radiobutton control with properties {static label:myButton, checked state:false}
          end repeat
          end tell
          end tell
          end tell
          end tell
          end tell
          end tell
          end tell
          set myResult to show myDialog
          if myResult = true then
          set x to selected button of myLabelsButtons
          set myButtton to x + 1
          set myPreset to item myButtton of PresetList
          end if
          destroy myDialog
          end tell

          tell application "Finder"
          activate
          set thefolder to choose folder with prompt "Select a Folder with InDesign Files to be Printed" as text
          set thePath to thefolder as text
          set the selected_items to every item of folder thefolder
          if the selected_items is {} then
          beep
          display dialog "Please select a folder with InDesign files before running this script." buttons {"Cancel"} default button 1
          end if
          repeat with aFile in selected_items
          --this gets just the ID files
          if class of aFile is document file and creator type of aFile is "InDn" then
          tell application "Adobe InDesign CS3"
          activate
          with timeout of 600 seconds
          set user interaction level of script preferences to never interact
          open aFile
          tell document 1
          tell print preferences
          set active printer preset to myPreset
          set page range to all pages
          end tell
          print without print dialog
          close saving no
          end tell
          end timeout
          --might need this delay
          --delay 10
          set user interaction level of script preferences to interact with all
          end tell
          end if
          end repeat
          end tell
          --------------------------------------------------------------------------
          Kasyan
          • 2. Re: My batch print script won't work in CS3
            Ads-R-Us Level 1
            Kasyan,
            That got it!

            Thanks,
            Chris