selecting a range of text
Using InDesign cs3, ExtendScript.
Searching through text in a story (text flowed in to threaded text frames).
After finding a particular word I want to return the index of the parent paragraph or line that word is found in.
Then I want to select a range of text, using the returned indices of those paragraphs/lines.
I can select ranges of text no problem with the "app.select()" function.
The issue is coming up with those parameters to pass to it from within the script dynamically.
I'm searching the text with my own function because it seems the built-in "Find/Replace" returns the array of found objects, but not their individual locations in the document/story.
Help appreciated.