3 Replies Latest reply on Jun 16, 2014 2:24 AM by HarveyLiu

    How Can I write a script for change first indent?

    HarveyLiu Level 1

      How can I write a java script to tell indesign:

       

      what ever the text first indent is, I want to change first indent =

       

      1) 8mm

      2) 0mm

      3)-8mm (if left indent is 0, change the first indent to 8mm, and then change first indent = -8)

       

      3 scripts

       

      Please someone help me, please!

        • 1. Re: How Can I write a script for change first indent?
          hasvi Level 1

          Hi,

           

          I am not clear what are saying, but try this

          app.scriptPreferences.measurementUnit = MeasurementUnits.MILLIMETERS; 

          var mydoc=app.activeDocument;

              var myFirstIndent=new Array ("8", "16")

              for(var i=1;i<myFirstIndent.length;i++)

              {

              app.findGrepPreferences = app.changeGrepPreferences = null;

              app.findGrepPreferences.firstLineIndent  = myFirstIndent[i];

              app.changeGrepPreferences.firstLineIndent  = -8;

              app.changeGrepPreferences.leftIndent  = 8;

              app.changeGrep();

              exit();

              app.findGrepPreferences = app.changeGrepPreferences = null;

              }

          by

          hasvi

          • 2. Re: How Can I write a script for change first indent?
            HarveyLiu Level 1


            Hi

             

             

             

             

             

             

            • 3. Re: How Can I write a script for change first indent?
              HarveyLiu Level 1

              Your idea very close, if change it into three script it will very perfect!

               

              thanks