2 Replies Latest reply on Aug 6, 2012 4:14 AM by M Karthik

    How to apply the two different styles using find and replace

    M Karthik Level 1

      Hello All,

       

      In the manuscript i have lot of bullet list paragraphs. In indesign i have three styles (Bullet first, Bullet Middle, and Bullet Last).I can easily applied the Bullet Middle (BL) style for all the bullet list paragraphs. Now i need to apply the Bullet first (BL1) and Bullet Last (BL2) style. I have used the below script, but this is not applied the specfic styles.

       

      app.findTextPreferences.appliedParagraphStyle=app.activeDocument.paragraphStyles.item("BL");
      var myResults = app.activeDocument.findText();
           for (i = 0; i <= myResults.length - 1; i++) 
           { 
                myResults.select; 
                var mySel = app.selection[0];
                var myParagraphs = mySel.paragraphs.length;
                //alert(myParagraphs);
                mySel.paragraphs[0].appliedParagraphStyle = "BL1";
                mySel.paragraphs[myParagraphs-1].appliedParagraphStyle = "BL2";
           }
      

       

      Kindly help me on this.......