3 Replies Latest reply on Jun 25, 2014 10:17 PM by Chinnadk

    Cannot get the paragraphs contents in findGrep result

    AR_FC_Script

      I want to get which paragraph was applied "01H" this style, since I use findgrep cannot get any result of contents

      anyone have any idea to help me?

       

      var myEnd =app.selection[0].paragraphs[0];

      var myStart = app.selection[0].parent.paragraphs[0];

      app.findGrepPreferences = NothingEnum.NOTHING ;

      app.changeGrepPreferences = NothingEnum.NOTHING ;

      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item("Eng").paragraphStyles.item("01H");

      app.findGrepPreferences.findWhat = "^.+$\r";

      myRange = app.selection[0].paragraphs.itemByRange(myStart, myEnd);

      var myFindGrep = myRange.findGrep()

      alert (myFindGrep.contents)

       

      Thx a lot