11 Replies Latest reply on Aug 18, 2016 5:45 AM by Obi-wan Kenobi

    GREP space plus dot using extendscript




      I try to remove all spaces before a dot using a GREP formula.


      GREP of "\s+\." works fine in the InDesign user interface but as soon as I try to make it work as a script, it no more works and the result is a replacement of all spaces by a space plus a dot !


      My script works for different other grep changes.

      It looks like :


      app.changeGrepPreferences = NothingEnum.nothing;

          app.findGrepPreferences = NothingEnum.nothing;


          app.findChangeGrepOptions.includeFootnotes = true;

          app.findChangeGrepOptions.includeHiddenLayers = false;

          app.findChangeGrepOptions.includeLockedLayersForFind = false;

          app.findChangeGrepOptions.includeLockedStoriesForFind = true;

          app.findChangeGrepOptions.includeMasterPages = false;


              app.findGrepPreferences.findWhat = "\s+\.";

              app.changeGrepPreferences.changeTo = "\.";



      Any idea on how to make that works ?