1 Reply Latest reply on May 21, 2014 8:53 PM by Chinnadk

    Increase the space in paragraph style

    hasvi Level 1

      Hi,

       

      My Indesign file has 'EXT and QUOTES' paragraph styles, now I want to increase the above and below space-2 points(by default) for 'EXT and QUOTES'. Is this possible my script.

       

      by

      hasvi

        • 1. Re: Increase the space in paragraph style
          Chinnadk Level 4

          Hi Hasvi,

           

          Use the below code.

           

          var doc = app.activeDocument;

          var paras = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements();

          var oldhmunits = doc.viewPreferences.horizontalMeasurementUnits;

          var oldvmunits = doc.viewPreferences.verticalMeasurementUnits;

          doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

          doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

          for(var i =0;i<paras.length;i++)

          {

              if(paras[i].appliedParagraphStyle.name == "EXT" || paras[i].appliedParagraphStyle.name=="QUOTES")

              {

                  paras[i].spaceBefore =paras[i].spaceBefore +  2;

                  paras[i].spaceAfter =paras[i].spaceAfter + 2;

                  }

          }

          doc.viewPreferences.horizontalMeasurementUnits = oldhmunits;

          doc.viewPreferences.verticalMeasurementUnits = oldvmunits;

           

          Regards,

          Chinna