• 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
Coercion of string to a record label
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Coercion of string to a record label


  • Subject: Coercion of string to a record label
  • From: Olof Hellman <email@hidden>
  • Date: Tue, 09 Oct 2001 10:11:45 -0700

Ah, my favorite topic. From a suggestion of mine, cleaned up by Emmanuel:


to usrf(theList)
script
{+class usrf;:theList}
end script
run script the result
end usrf

usrf({"a", 1, "b", 2})

--> {a:1, b:2}


The only problem is, due to canonicalization of AppleScript user record
field tags, everything in the tag string must be lower case. If not, you
need to use the bars to make it work:

usrf({"three word tag", 1, "UPPERCASE", 2})

--> {|three word tag|:1, |UPPERCASE|:2}

- Olof


n.b. As usual, the chevrons will get mangled by the listserv: the
characters around

+class usrf;

are the left-pointing and right-pointing chevrons, option backslash + and
shift option backslash ; .


  • Follow-Ups:
    • Re: Coercion of string to a record label
      • From: Harald E Brandt <email@hidden>
  • Prev by Date: Re: Scripting Airport?
  • Next by Date: RE: Scripting Airport?
  • Previous by thread: Re: Coercion of string to a record property label
  • Next by thread: Re: Coercion of string to a record label
  • Index(es):
    • Date
    • Thread