1 Reply Latest reply on Feb 11, 2009 8:28 AM by (SuperMacGuy)

    Setting Preferences Script (apple script) ID CS3

      Power Pc G5 Mac Indesign 3

      Hello Im trying to set the preferences in indesign to a common set with in the studio.

      After reading the help files I understoud I can't copy the preferences file to each computer and have to make a script.

      I downloaded a load of resources of the adobe web site. And found a script that sets rule units (see below).

      --ViewPreferences.applescript
      --An InDesign CS3 AppleScript
      --
      --Sets the measurement units to points.
      --Assumes you have a document open.
      tell application "Adobe InDesign CS3"
      tell view preferences
      --Measurement unit choices are:
      --picas, points, inches, inches decimal, millimeters, centimeters, or ciceros
      --Set horizontal and vertical measurement units to points.
      set horizontal measurement units to points
      set vertical measurement units to points

      end tell
      end tell

      this worked well

      This looked like a good starting point, all I,ve got to do is set all the preferences. but I cant work out how you get the names eg 'horizontal measurement in view preferences' in indesign its units & increments; rule units: horizontal.

      For a start I tried to get it to change the origin so I edited the script (see below), I also tried to change keyboard Increments with no joy.
      Can anyone help?
      In the indesign help files they make it sound easy... (the old copying quark preferences file to each computer was).

      Regards Rupert

      --ViewPreferences.applescript
      --An InDesign CS3 AppleScript
      --
      --Sets the measurement units to points.
      --Assumes you have a document open.
      tell application "Adobe InDesign CS3"
      tell view preferences
      --Measurement unit choices are:
      --picas, points, inches, inches decimal, millimeters, centimeters, or ciceros
      --Set horizontal and vertical measurement units to points.
      set origin to page
      set horizontal measurement units to points
      set vertical measurement units to points

      end tell


      end tell
        • 1. Re: Setting Preferences Script (apple script) ID CS3
          Level 1
          Hi Rupert,
          your reference for the page origin is not correct. You can't just say "origin" its actually "ruler origin" and to set it, you have to use the constant "page origin".
          If you are using Script Editor, or Script Debugger, you'll see that in your script the word "origin" is probably green. Green is a variable name. And you want to talk to the object or class, which will always show up in blue. Another tip, not sure how far along in scripting you are, is you should open up the dictionary for InDesign and you can see the classes and objects and keywords it uses. It's a little obtuse for beginners, but what you need is actually all there. You'll find many preferences aren't just in a generic "preference" area in Indesign, you must tell the View preference, or Document Preferences, or PDF export preferences, etc. You will definitely want to look at the Dictionary.

          tell application "Adobe InDesign CS3"
          tell view preferences
          --Measurement unit choices are:
          --picas, points, inches, inches decimal, millimeters, centimeters, or ciceros
          --Set horizontal and vertical measurement units to points.
          set ruler origin to page origin
          set horizontal measurement units to points
          set vertical measurement units to points
          end tell
          end tell