Re: Records in handlers
Re: Records in handlers
- Subject: Re: Records in handlers
- From: Emmanuel <email@hidden>
- Date: Mon, 6 Feb 2006 14:23:06 +0100
At 2:13 PM +0100 2/6/06, Jay Louvion wrote:
on GetDetails(who)
set TheRecord to {Mine:{theAddress:"email@hidden",
thelink:"<http://www.ical.mac.com/jay/jay>http://www.ical.mac.com/jay/jay"},
His:{theAddress:"email@hidden",
thelink:"<http://www.ical.mac.com/jay/him>http://www.ical.mac.com/jay/him"}}
return theAddress of who of TheRecord
end GetDetails
With a "Can't get who of {Mine:{theAddress:"email@hidden",
thelink:"<http://www.ical.mac.com/jay/jay>http://www.ical.mac.com/jay/jay"},
His:{theAddress:"email@hidden",
thelink:"<http://www.ical.mac.com/jay/him>http://www.ical.mac.com/jay/him"}}."
error. Rather fun to read, but kinda disappointing to a young
scripter like myself.
When you want to use a variable as a key (you would like something
like "set who to His"), then it may be time to work with p-lists. In
a p-list, keys are normal strings so you would do something like:
set who to "His"
set oneRec to PlistChild theRecord key who
return theAddress of (PlistGet oneRec)
More details at: <http://www.satimage-software.com/en/plist_suite.html>
Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden