Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP find not working in javascript

Return to Member Forum

  • Author
    Posts
    • #67399

      I am writing a script that uses several grep find/change queries. They all work apart from this one “Zr” that aims to delete the last return at the end of a story.

      This and variations of it work fine in the find/change dialog but not in the script. Any help would be much appreciated.

    • #67404

      In a script, try using positive lookahead “r(?=Z)” for findWhat property. Note, this will also delete the last return at the end of any table cell as well. Works in InDesign CS6.

    • #67424

      Actually you don’t need a lookahead for the ‘position markers’ $ and \Z. Stuart mentions he tried some variations, but maybe he overlooked the simplest possible case:

      rZ

      — that is, the return occurs *before* the end of story.

      • #67426

        I thought that should work, but I tried rZ using InDesign CS6 on Mac and could not get it to work.

      • #67427

        rZ does appear to work in InDesign CC.

    • #67428

      Thank you guys for your help with this. Jongware, I could have sworn I’d tried that variation but obviously not as it works a treat in CC.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads