• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Property of a record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Property of a record


  • Subject: Re: Property of a record
  • From: Jim Brandt <email@hidden>
  • Date: Tue, 17 May 2011 14:15:19 -0500

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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Property of a record (From: Jim Brandt <email@hidden>)

  • Prev by Date: Re: Property of a record
  • Next by Date: Why
  • Previous by thread: Re: Property of a record
  • Next by thread: Re: Property of a record
  • Index(es):
    • Date
    • Thread