7 Replies Latest reply on Feb 29, 2012 9:54 AM by rafikibubu

    How to get findGrep() to return "found 1"

    rafikibubu Level 1

      InDesign 5.5, Javascrpt, Mac OSX

      ------------------

       

      Hi all,

       

      Yet another seemingly simple issue that I just can't seem to crack.

       

      I have a list of towns in a text box, with each line in the following format:

       

      44 (tab) townName

       

       

      I'm trying to get a script to do a grep find that will give me back only the town name.

       

       

      The correct grep find code on the Find/Change dialog would be (I think):

       

      ^\d+\t(.*)$

       

       

      $1, or "found text 1" would then give me what I want. So is there any way for me to get the findGrep() method to return the value of $1? I can only seem to get it to give me the whole line.

       

       

      If not, does anyone have any suggestions on how I can get the town name out of that result in another fashion?

       

       

      Thanks much to any and all.

       

      ~Nate