1 Reply Latest reply on Feb 22, 2011 2:16 PM by [Jongware]-9BC6tI

    search text by character style




      I need to creat a script who search all text in a document by a character style.


      Can help tu set the search :


      // any text formated 00.00 (exemple : 01.33, 45.34 ...);

      // using the character style : myStyle


      Thanks for your help

        • 1. Re: search text by character style
          [Jongware]-9BC6tI Level 4

          It's all in the Javascript Reference guide:


          app.findTextPreferences = null;
          app.findTextPreferences.findWhat = "^9^9.^9^9";
          app.findTextPreferences.appliedCharacterStyle = app.activeDocument.characterStyles.item("myStyle");
          result = app.activeDocument.findText();
          alert (result.length+" item(s) found");


          (Typed entirely from memory, but it should work.)