4 Replies Latest reply on Oct 9, 2018 1:15 AM by GunIva

    Grep deleting extra returns

    GunIva Level 1

      Hi,

      I am trying to remove extra returns at the end of a story, but my script remove returns at the end of every paragraph.
      How can I make it delete only extra returns at the end of a story?

       

      function myFindGrepDelEmpty(myObject){
          app.findGrepPreferences = null;
          app.changeGrepPreferences = null;
          app.findGrepPreferences.properties = {findWhat:"^\\s+|\\s+$"};
          app.changeGrepPreferences.properties = {changeTo:""};
          app.findChangeGrepOptions.properties = {includeFootnotes:true, includeMasterPages:false, includeHiddenLayers:true, wholeWord:false};
          myObject.changeGrep();
      }