You need to use GREP searches, not text searches. Your post suggests that you're not familiar with GREP, and you could do yourself no bigger favout than learning some basics. Try this search pattern in the GREp tab of the Find/Change dialog:
\d stands for 'digit', + stands for 'one or more', so \d+ stands for 'one or more digits', i.e. any number. The question mark stands for 'shortest match' -- you'll have to read up on that yourself.
In a script you would use this:
app.findGrepPreferences.findWhat = /150\d+?-\d+/.source
Thanks for the input. You're right, a GREP search is much more efficient. But what I'm trying to do and the circumstances here don't allow me, I think, to go that route. I am trying to generate a list of values coming from several textframes on a single page and have them come out so that I can tell which values belong together.
I'm using an inherited document with masters that were created 'manually'; the index numbering for textframes and tables is random. I navigate through the pages, looping through textframe indices asking ' does this textframe exist?' If so, I ask if it is a table -- if no, it is a simple textframe and I ask about the ID, if yes, I ask if the contents of cell (0,0) (invariant position and contents) are equal to the table I want.. I am sending the ID and other pieces of information from the table to one row of a new table on a new page. So the ID and other information from a single page are linked by being in the same row.
I know this a little 'off-normal' -- I'm using the search to navigate through the document and find things by location the way you do with a spreadsheet. I have devised a work-around that helps me get around the fact that the ID is not invariant. I create a list of the (exact) IDs from another document, equating them to a variable ('a'). I then loop through the list of IDs and ask if the contents of the textframe is equal to 'a'..This works o.k, unless there happens to be an extra space, a different kind of hyphen, etc. It would be so much easier if I could use the wildcards that work in a menu-driven text or GREP search in script just to ask about the contents of the textframe.
pcbaz (Peter BIerly)
P.S. we have since rewritten the masters so this problem will not exist in the future -- we now know exactly which textframe and/or table indices to refer to to get any particular bits of information and don't need to ask questions about the contents.