• 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: Nigel Garvey <email@hidden>
  • Date: Tue, 17 May 2011 19:47:08 +0100

Jim Brandt wrote on Tue, 17 May 2011 09:47:20 -0500:

>I'm having a problem retrieving a part of a record. The record is the
>result of a search command from "TextCommands" using the find match
>info option.

>	tell application "TextCommands"
>		set y to search x for "<tr.*?</tr>" finding match info 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 range
>				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

>tr_start and tr_end display as expected but the variable RowText is
>always empty.

>BTW, PowerPC running 10.4.11, Script Editor 2.1.2

I _think_ the problem is that you're running it Tiger, where 'text' is
synonymous with 'string' rather than with 'Unicode text', which is
presumably what's returned by TextCommands. The line …

  set RowText to it's text

… returns a list containing every value of class 'text' in the record —
that is, the _property_ 'text' is ignored. In Tiger's version of
AppleScript, 'Unicode text' is not 'text', so the list returned is
empty. These work on my Tiger machine:

  set {text:RowText} to it

  set RowText to item 1 of (its every Unicode Text)

  set RowText to first Unicode text of (it as list)

NG
 _______________________________________________
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

  • Prev by Date: Re: Problem with this list
  • Next by Date: Re: Property of a record
  • Previous by thread: Re: Property of a record
  • Next by thread: Re: Property of a record
  • Index(es):
    • Date
    • Thread