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

Javascript to Find/Replace text from Grep

Return to Member Forum

  • Author
    Posts
    • #62296
      Anonymous
      Inactive

      I need a javascript to find/replace text from Grep command. For example, to add an anchored object at the beginning of a heading. I know how to do it from Indesign grep command (cut object to clipboard first) then find ^(.) and replace it with ~C$1.

      Please advice.

    • #62315
      Chuck Nigash
      Member

      This is a good link and will lead you to what you want.

      https://creativepro.com/fin…..odness.php

    • #62316
      Chuck Nigash
      Member

      … and ultimately this. https://www.kasyan.ho.com.ua/find_change_by_queries.html

      This record find change currently supports text and not GREP. With maybe some tweaking, you could get what you want. I am after something similar to build arbitrary fractions.

    • #62317
      Chuck Nigash
      Member

      Another good one from Kasyan's site. See if this one works for you too.

      https://www.kasyan.ho.com.ua/cr…..chors.html

    • #62323
      Lala Lala
      Participant

      Second vote for that last script, I find it very easy to use… there's a text file, you just throw a line into the text file, at the bottom. I think it would look something like:

      grep {findWhat:”^(.)”} {changeTo:”~C$1″} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

      Not sure if you would leave those quotes or not… but that's the gist of it.

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