Skip navigation
greenrookie
Currently Being Moderated

Loading personal preferences

Jul 21, 2012 11:24 PM

Hi everyone,

 

This is from an old post from 2009 originally in the InDesign forum, http://forums.adobe.com/thread/451768?start=0&tstart=0

 

This JS that Harbs wrote works great for me in IDCS4.

 

 

try{SetPrefs()}
catch(e){}

function SetPrefs(){
  var e;
  var doc=app.documents[0];
  doc.viewPreferences.properties= {
    horizontalMeasurementUnits : MeasurementUnits.points,
    verticalMeasurementUnits : MeasurementUnits.points,
    rulerOrigin : RulerOrigin.PAGE_ORIGIN,
    cursorKeyIncrement : 1
  };
    
  doc.textPreferences.properties = {
    superscriptPosition : 33.3,
    superscriptSize : 65,
    subscriptPosition : 33.3,
    subscriptSize : 65,
    smallCap : 75,
    baselineShiftKeyIncrement : 0.1,
    leadingKeyIncrement : 0.1
  }
    
  var styleProps = {
    composer : "Adobe Single-line Composer",
    minimumWordSpacing : 85,
    desiredWordSpacing : 100,
    maximumWordSpacing : 133,
    minimumLetterSpacing : 0.0,
    desiredLetterSpacing : 0.0,
    maximumLetterSpacing : 0.0,
    hyphenateAfterFirst : 2,
    hyphenateBeforeLast : 3,
    hyphenateLadderLimit : 2,
    hyphenateCapitalizedWords : true
  }
  try{var styles=doc.allParagraphStyles;}
  catch(e){var styles = doc.paragraphStyles}
  for(var i=1;i<styles.length;i++){
    styles[i].properties=styleProps;
  }
}

 

Is there a way to make this script toggle between the custom settings here, then setting them back to the original document settings?

 

Many thanks,

 

gr

 
Replies
  • Currently Being Moderated
    Jul 23, 2012 4:17 AM   in reply to greenrookie

    To do that, you're going to have to write the original settings somewhere in the doc.

     

    Harbs

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points