Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A new message was posted by Robert_Tkaczyk in
InDesign Scripting --
CS3 Javascript - finding the paragraph which contain the index page reference
if you need to get page - you don't need paragraph index - you can get page by getting parent of ParentTextFrame of first character of your paragraph
in VB it will be something like this:
PageName = myPara.Characters.Item(1).ParentTextFrames.Item(1).Parent.Name
robin
--
www.adobescripts.com
------------------------------------------------------
View/reply at < http://www.adobeforums.com/webx?13@@.59b75803/2>
Replies by email are OK.
Use the unsubscribe form at < http://www.adobeforums.com/webx?280@@.59b75803!folder=.eea52bc> to cancel your email subscription.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A new message was posted by Peter Kahrel in
InDesign Scripting --
CS3 Javascript - finding the paragraph which contain the index page reference
myPara.index is the index of myPara's first insertion point, so ...texts.itemByRange (0, myPara.index) tries to range over far more Texts than there are in the story. Instead, range over characters:
myPcount = myPara.parentStory.characters.itemByRange(0, myPara.index).paragraphs.length;
Peter
View/reply at CS3 Javascript - finding the paragraph which contain the index page reference
Replies by email are OK.
Use the unsubscribe form to cancel your email subscription.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
A new message was posted by Peter Kahrel in
InDesign Scripting --
CS3 Javascript - finding the paragraph which contain the index page reference
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
View/reply at CS3 Javascript - finding the paragraph which contain the index page reference
Replies by email are OK.
Use the unsubscribe form to cancel your email subscription.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
myStory = result(1).parent;Dave
myLine = result(1).lines[0];
lineCount = myStory.characters.itemByRange(0,myLine.index).texts[0].lines.length;
Copy link to clipboard
Copied
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more