20 Replies Latest reply on Mar 5, 2009 5:38 AM by Kasyan Servetsky

    InDesign CS3 resize images 100% script

      I've been using this apple script (one of my favorites), probably written by Rob Day, that resamples all the images in a InDesign document to 100%. Once I started it it asks me what resolution I want (300dpi is pre-set) and where I want the resampled links to be saved. Then it goes through the document and opens up every image and sizes it down to the percentage it was placed, saves it to the folder I determined before and updates the image in InDesign, placing it 100%.

      It always worked pretty good, but for some reason now I get an error message all the time. I switched from Indesign CS2 to CS3 which might be the problem.

      Does anybody know how to fix the script for CS3?

      Or is there anything similar already out there for CS3?

      Any help is appreciated since I need to get this 550 page catalog done... THANK YOU.

      here is the script:

      myDisplayDialog()
      on myDisplayDialog()
      tell application "Adobe InDesign CS3"
      activate
      set myDialog to make dialog with properties {name:"Resample images"}
      tell myDialog
      tell (make dialog column)
      --Dialog row containing integer editbox.
      tell (make dialog row)
      tell (make dialog column)
      make static text with properties {static label:"dpi:"}
      end tell
      tell (make dialog column)
      set myIntegerEditbox to make integer editbox with properties {edit value:300}
      end tell
      end tell
      end tell
      end tell
      set myResult to show myDialog
      if myResult is true then
      --Get the values from the various editboxes.
      set myInteger to edit value of myIntegerEditbox
      destroy myDialog
      set myProcessedLinks to {}
      set myFolder to choose folder with prompt "Select a destination folder for resampled images"
      tell application "Adobe InDesign CS3"

      --If transformation preferences are not set to transformations are totals
      --we have to set them for the script to work.
      if transformations are totals of transform preferences is false then
      set myOldTransPreferences to properties of transform preferences
      set transformations are totals of transform preferences to true
      set show content offset of transform preferences to true
      set dimensions include stroke weight of transform preferences to true
      set «class TrCt» of transform preferences to true
      set myResetTransform to true
      else
      set myResetTransform to false
      end if
      set myDocument to active document
      tell myDocument
      --If the measurement units of the active document are not inches, set the
      --measurement units to inches. Units MUST be inches in order to script work.
      if horizontal measurement units of view preferences of myDocument is not points or ¬
      vertical measurement units of view preferences of myDocument is not points then
      set myOldViewPreferences to properties of view preferences of myDocument
      set horizontal measurement units of view preferences of myDocument to points
      set vertical measurement units of view preferences of myDocument to points
      set myResetUnits to true
      else
      set myResetUnits to false
      end if


      set outdateLinks to every link whose status is link out of date
      repeat with OODLinks from (count outdateLinks) to 1 by -1
      update link of item OODLinks of outdateLinks
      end repeat
      set IDLinks to every link whose status is normal
      --Iterate backwards through the links to avoid invalidating objects.
      repeat with myCounter from (count IDLinks) to 1 by -1
      set myLink to item myCounter of IDLinks

      --Process only image links.
      set myLinkedFile to file path of myLink as alias
      set myLinkType to link type of myLink
      tell application "Finder" to set fileCreator to file creator of (info for myLinkedFile)
      --If statement expanded to isolate PS EPS from AI EPS.
      if (myLinkType = "TIFF") or (myLinkType = "Photoshop") or ((myLinkType = "EPS")