Michael,
Thanks. Yes, that works, but it doesn't answer the original question.
I was looking for the correct syntax to retrieve, from a record that has a property called "text", the value of that property.
While it is true that I can get that value using your code, I am also curious to know how do do it from the record provided by "TextCommands". I need to know this because I want to have both the starting and ending offsets of the text as well as the text itself and want to process it in a single command. The text is already in the record (it displays in the events log), so now I just need to know to extract it from that record.
This has both a practical and academic purpose for me. I learn from this so I will know how to do it in the future.
On May 17, 2011, at 12:30 PM, Michael Ghilissen wrote: Jim,
This works, except for (item row of y).
HTH
Michael
set x to "<table> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table>" tell application "TextCommands" set y to search x for "<tr.*?</tr>" with regex set cnt to count of y repeat with row from 1 to cnt log item row of y -- debug show it in the log tell item row of y set tr to it's text set tr_start to item 1 of tr set tr_end to item 2 of tr set RowText to it's text -- text of the row end tell set mess to (tr_start as text) & tab & tr_end as text set mess to mess & return & RowText display dialog mess -- debug end repeat end tell -- TextCommands |