Indesign- Text Frame Search Order

Hi Folks-

When I do a search of text frames in an InDesign CS2 4.05 document the function does not go through the pages sequentially, rather, it skips around. I need to figure out how to one of the following:

a- restrict the search function to a specific page

(the following:


set search results to search page 1 for "1.^9^9^9^9^9^9.^9^9^9"

and other phrasings does not work)

or

b- search the frames are searched in order

the only other option I can see is breaking the document into separate documents, consisting of 1 spread each.

any help would be appreciated!

thanks,

Ralph

Well, folks- I figured out how to do this. By restricting the search to a given page, it’s possible to select the text frames from that page and then restrict the search to those frames. By stepping through the pages, I can ensure the order of the item codes is correct. Below is the relevant code, though the stepping function hasn’t been built out yet:


tell application "Adobe InDesign CS2"
	select every text frame of the page 2 of active document
	set searchResults to search selection for "1.^9^9^9^9^9^9.^9^9^9"
end tell
--display dialog searchResults

if (item 1 of searchResults) = {} then
	set fullcode to ((item 2 of searchResults) as string)
else
	set fullcode to ((item 1 of searchResults) as string)
end if
display dialog fullcode

:smiley:

-Ralph