4 Replies Latest reply on Sep 1, 2010 9:22 PM by Green4ever

    Applying paragraph style without clearing overrides, I need this in other way. Help me on this..

    Green4ever Level 3

      Hi

       

      Here i m finding a particular paragraph style and replacing it with the another paragraph style without clearing overrides.

      The below script is working very fine.

       

      ps = app.activeDocument.paragraphStyles.item ('Tx2');
      s = app.activeDocument.stories;
      for (i = 0; i < s.length; i++)
         {
         p = s[i].paragraphs;
         for (j = 0; j < p.length; j++)
            {
                psname = p[j].appliedParagraphStyle.name;
                //alert(pname);
               if (psname == "Tx1"){
                  p[j].applyParagraphStyle (ps, false);
                  }
           }
         }

       

       

      But is there anyother way to do this....Can one help me on this regard. For example, I tried this in the below manner...

       

      var myDoc = app.documents[0];
      app.findTextPreferences = null;
      app.findTextPreferences.appliedParagraphStyle = "Tx1";
      myFind = myDoc.findText(true);
      ps = app.activeDocument.paragraphStyles.item ('Tx2');

       

      << Here i need some help like applyParagraphStyle (ps, false);>>

       

       

      Is this possible in this way???.......

       

       

      Thanks in advance...