2 Replies Latest reply on Nov 12, 2014 3:31 AM by Murali_Vetha

    More documents to change

    Murali_Vetha Level 1

      Hi All,

       

      //This below coding is used to find specified paragraphstyle and change its fontsize, but I need to do change this request at more indesign files. And also advice which ways could we find?

       

      var mydoc = app.activeDocument;

      var mypstyle = mydoc.paragraphStyles.everyItem().getElements();

       

      for (i=0; i < mypstyle.length; i++)

      {

      if (mypstyle[i].name == "Text")

          {

              mypstyle[i].pointSize = 15;

              }

      }

          alert ("Done")

        • 1. Re: More documents to change
          BEGINNER_X Level 3

          Hi,

           

          Use the below code:

           

          var mydoc = app.documents;
          //~ alert(mydoc.length)
          
          var mypstyle = app.activeDocument.paragraphStyles.everyItem().getElements();
          
          for(i=0; i<mydoc.length; i++)
          {
              var myPStyle = mydoc[i].paragraphStyles.everyItem().getElements();
              
              for(p=0; p<myPStyle.length; p++)
              {
                  if(myPStyle[p].name == "Text")
                  {
                      myPStyle[p].pointSize = 20;
                      }
                  }
              }
          

           

          Regards

          Siraj

          • 2. Re: More documents to change
            Murali_Vetha Level 1

            Hi All,

             

            The below coding works fine, but I don't have receive correct option button in indesign scripting forum. If there is any solution.

             

            See below the screen shot:

             

            Screen shot.png

            Regards,

            Vetha