5 Replies Latest reply on Apr 18, 2010 8:10 AM by Tom Tomasko

    [JS CS3] Why does Grep search for superscripted numbers not work?

    Tom Tomasko Level 1



      Below is a script that does a Grep search for any one to three digit number that is superscripted. Well, that is what it is supposed to return, but it returns all one to three digit numbers. Any suggestions on what is wrong? If I do a manual Grep search for numbers that are superscripted it works fine, so I know it can be done.




      var myDoc = app.activeDocument;
      var endNotes = theGrepFinder(myDoc,"\\d{1,3}");


      function theGrepFinder(docRef,grepFindIt){
          app.findGrepPreferences = NothingEnum.NOTHING;
          app.changeGrepPreferences = NothingEnum.NOTHING;
          app.findGrepPreferences.appliedCharacterStyle.position = Position.SUPERSCRIPT;
          app.findGrepPreferences.findWhat = grepFindIt;
          var arrGrepFindIt = myDoc.findGrep();
          return arrGrepFindIt;