4 Replies Latest reply on Aug 7, 2015 5:58 AM by machipotHocine

    Next paragraph following the GREP changeTo

    machipotHocine

      Hi, I am trying to locate the next paragraph following the  changeTextPreferences.changeTo where I am applying a GREP to find a word/s between quotation marks

      Thank you,

      The line in My code which is supposed to extract the index

      var Currentparagrap = EnFrColumn.paragraphs.index;      //is not working

       

      my code:

      trace("Remove Quotation Marks than bold the word/s in between (EN column)");

         var results = "";

        var xmlElement = ""; //--- xml tag associated to the findGrep string

      var strChangeTo = ""; //--- changeTo string with quotations

      var strtChangeToNew = ""; //--- ChangeTo string quotations removed

        if (EnFrColumn == "en"){

      app.findGrepPreferences.findWhat =  '(")(\\w+)(")';

        results = this.document.findGrep();

      if(results != null)

        for(var j=0; j< results.length; j++)

        if (xmlElement.markupTag.name == "ENMarginalNote"){

        if (app.findTextPreferences.findWhat = strChangeTo){

        app.changeTextPreferences.fontStyle = "Bold Italic";

       

      //// want to change only the first word/s and the word/s in the following paragraph

       

       

       

      story.changeText();

       

      }

       

       

      app.findTextPreferences = NothingEnum.nothing;

       

      app.changeTextPreferences = NothingEnum.nothing;

      }

      }

      }

      ]