Re: working with records
Re: working with records
- Subject: Re: working with records
- From: Philip Aker <email@hidden>
- Date: Tue, 21 Aug 2007 13:36:35 -0700
On 2007-08-21, at 13:06:49, Wayne Melrose wrote: On 21/08/2007, at 10:02 PM, Stan Cleveland wrote: set rec to {username:"wayne", emailadd:" email@hidden", blah:7} set {username, emailadd, blah} to {username, emailadd, blah} of rec username --> "wayne" blah --> 7
that's not bad at all :)
Further to that question and to try and simplify your already good suggestion..
we can get the items of the rec variable by using
get items of rec
set reco to {username:"wayne", emailadd:"email@hidden", blah:7} reco as list
can we get the labels the same way?
No, unless you want to use an ugly hack which has some prerequisites. Basically you have to snag the error string and parse it for the labels:
try reco as text on error errs number errn return errs end try --> "Can't make {username:\"wayne\", emailadd:\"email@hidden\", blah:7} into type string."
|
_______________________________________________
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