🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15089

Re: Changing the contents property of a word (IDCS)

#15089
From: Shane_Stanley
Date: Tue, 16 Dec 2003 20:26
13 lines
1247 bytes
You have a problem because your replace string is smaller than your 
search string. All the references to the search string are based on 
offset in the story, and as soon as you make the first replace, the 
rest of your references are invalid. The solution is to rewrite your 
code so you replace in the reverse order, from last to first. Something 
like:

repeat with i from (count of items of myPriceHolderList) to 1 by -1
set contents of item i of myPriceHolderList  to "$PRICE"
...

--
Shane Stanley <sstanley@myriad-com.com.au>
Technical Details
Message-ID: <2ABE98BE-3006-11D8-B005-003065D61B90@myriad-com.com.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2ccef3cf.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,6afd82e038dd93a1
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-16 12:37:59 PST
From: Shane_Stanley@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: Changing the contents property of a word (IDCS)
Message-ID: <2ABE98BE-3006-11D8-B005-003065D61B90@myriad-com.com.au>
Date: Tue, 16 Dec 2003 12:26:45 -0800
References: <2ccef3cf.-1@webx.la2eafNXanI>
Lines: 15
X-Mailer: Apple Mail (2.606)
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit