5 Replies Latest reply on Feb 25, 2009 1:33 AM by (Joerg_Koch)

    Array of Text Objects changes when content of Elements is changed

      Hello

      I have a script that finds an array of text objects (via grep) that get analysed. When I change the contents of one of the Text Objects in the Array, the following Objects loose their "connection" to the Story Text they are in. The reference is changed by the amount an prior object's content was altered in length. When I walk through the array backwards everything is fine but as I want to expose some of the changes to the user for confirmation I'd like to do it in the order they appear in the text.

      Technically
      array consists of text objects, found by a regex search
      changing one array element after another shifts array reference of all subsequent array elements

      I need a way to prevent from that shift. But I can't find a method to change a text objects refernce information. Also I don't find a way how to create a new text object when all I have is it's start position and length relative to the parent story which would be an alternative too...

      Any Ideas?

      All the best, Joerg