0 Replies Latest reply on Feb 9, 2011 6:21 AM by ManMadeSelf

    A script for adding Tags based on search result

    ManMadeSelf

      Hello all fellow faithfuls of InDesign!

       

      I am looking at a challenge with my very basic (near to none) experience of scripting, that goes like this:

       

      I need a script that could search through my story/selection and look for patterns (such as four digits in a row, basic RegEx stuff) and add a specific Tag-element with some specific attributes and given values that would be taken from the found pattern.

       

      EXAMPLE: (Searching the text below)

       

      Product 7352     price 23,60

       

      Now the script would find: 7352 and tag it [7352] and give it attributes like RecordID = 7352 and Field = PRODUCTNR

      For the price it would find the 23,60 and give it the same RecordID = 7352 and Field = PRICE.

       

      How would I approach something like this?