🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #958

Array of Text Objects changes when content of Elements is changed

#958
From: Joerg_Koch
Date: Tue, 24 Feb 2009 14:43
13 lines
1575 bytes
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
Technical Details
Message-ID: <59b8095a.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,bf216ff92a3fd4a2,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Joerg_Koch@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Array of Text Objects changes when content of Elements is changed
Message-ID: <59b8095a.-1@webcrossing.la2eafNXanI>
Date: Tue, 24 Feb 2009 06:43:02 -0800
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit