2 Replies Latest reply on May 31, 2016 4:24 AM by McShaman

    GREP pattern not working in JavaScript

    McShaman Level 1

      The following pattern `\r+\Z` works in InDesigns GREP find and replace to replace blank paragraphs at the end of a story however it doesn't seem to work in the scripting environment.

       

      Why doesn't the following work:

       

      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;
      
      app.findGrepPreferences.findWhat = '\r+\Z';
      
      app.activeDocument.selection[0].changeGrep();