Article View: adobe.scripting.indesign
Article #8624Re: Get (relative) index of a paragraph inside a selection of paragraphs
From: Martin Fischer*
Date: Sun, 01 Oct 2006 16:18
Date: Sun, 01 Oct 2006 16:18
19 lines
2150 bytes
2150 bytes
Dave, you are right: the paragraphs are already sorted alphabetically. You have posted another approach than mine. And yours is much better for it takes into account that the object (contents of paragraphs) will change while processing the script. Starting from the back will avoid processing the script on changed pieces of the object. I was looking for a solution like this, but last night I couldn't figure it out. So I enlanced me in a double loop, well considering, that there could occur errors because of processing the script to an object that will change while the process. ;-) And after all the code looks very compact. It's not an exact answer to my question about the index of a paragraph inside a selection of paragraphs but it is a much better and more compact alternative than my double loop. But nevertheless is there a chance to find out the index of a paragraph inside a selection of paragraphs as I have asked above? You remember: I did a search for a string inside a selection of paragraphs and I would like to know what is the count of the paragraph of the selected paragraphs the last occurrence of the search string is in (the second, the third, the fourth or another counter paragraph of the selection). Robert, I didn't understand your VB example. Should I really count thru all paragraphs of the story (or selection) and compare the characters index with the paragraphs index to find out the index I am looking for? Martin
Technical Details
Message-ID:
<3bc1d60c.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news2.volia.net!news.ecp.fr!news.albasani.net!news.isoc.lu!webcrossingReferences:
<3bc1d60c.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,11f901afe18132ac X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Martin Fischer*" <martin.fischer@online.de> Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news.glorb.com!news2.volia.net!news.ecp.fr!news.albasani.net!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Get (relative) index of a paragraph inside a selection of paragraphs Message-ID: <3bc1d60c.3@webcrossing.la2eafNXanI> Date: Sun, 1 Oct 2006 09:18:11 -0700 References: <3bc1d60c.-1@webcrossing.la2eafNXanI> Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit