🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #2111

Re: CS3 Javascript - finding the paragraph which contain the index page reference

#2111
From: Peter Kahrel
Date: Sun, 04 Jan 2009 11:57
12 lines
1306 bytes

      myPara1Place = myPara1.parent.texts.itemByRange(0, myPara1.index)




myPara1.index returns the index of the first insertion point of the current paragraph within the story (myPara1.parent is a story), which could be in the thousands. But you're addressing probably just one text. It's as if you're asking for twenty lollies when there's just one in the jar.

When you use someobject.itemByRange (start, stop), "stop" must be smaller than (or equal to) the length of "someobject". Since there are (probably) as many characters in a story as there are indexes, in this case that's what you use for itemByRange's scope.

Peter
Technical Details
Message-ID: <59b75803.16@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!goblin2!goblin.stu.neva.ru!news4us.nl!webcrossing
References: <59b75803.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,4423827cf06ba747
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Peter Kahrel" <kahrel@kahrel.plus.com>
Newsgroups: adobe.scripting.indesign
Subject: Re: CS3 Javascript - finding the paragraph
 which contain the index page reference
Message-ID: <59b75803.16@webcrossing.la2eafNXanI>
Date: Sun, 4 Jan 2009 03:57:02 -0800
References: <59b75803.-1@webcrossing.la2eafNXanI>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!goblin2!goblin.stu.neva.ru!news4us.nl!webcrossing