3 Replies Latest reply on May 13, 2010 8:28 AM by Kasyan Servetsky

    How to use LayoutAdjustmentPreference using javascript?

    Muthuraj Durairaj Level 1

      Hi All,

       

      I am a beginner in Javascript scripting and need your help on this.

       

      I have a need to change the US letter size Indesign document into A4 letter document using Javascript. I tried to change the layout and succeed but when I tried LayoutAdjustmentPreference, I could not get the result as it throws error message.

       

      Below is the javascript I tried:

       

      var myDocument = app.activeDocument;
      
      
      
      
      
      with(myDocument.LayoutAdjustmentPreference){
      enableLayoutAdjustment = true
      snapZone = "2 pt"
      allowGraphicsToResize  = true
      allowRulerGuidesToMove = true
      ignoreRulerGuideAlignments = false
      ignoreObjectOrLayerLocks = true
      }
      with(myDocument.documentPreferences){
      pageSize = "A4"
      pageOrientation = PageOrientation.portrait;
      }
      


      Could you please clarify where have I gone wrong in this code? or any better ideas?