Records in handlers
Records in handlers
- Subject: Records in handlers
- From: Jay Louvion <email@hidden>
- Date: Mon, 06 Feb 2006 14:13:23 +0100
Title: Records in handlers
I’m getting to have “fun” with some handlers and records; Unfortunately stumbling on some tough piece I can’t figure out for myself.
This works fine:
set TheRecord to {Mine:{theAddress:"email@hidden", thelink:"http://www.ical.mac.com/jay/jay"}, His:{theAddress:"email@hidden", thelink:"http://www.ical.mac.com/jay/him"}}
return theAddress of His of TheRecord
But if the “His” is passed on as a param in a handler, or just from a text returned of dialog, it errors out. Am I supposed to coerce the text into a record or something ? I’ve tried, but it doesn’t seem to yield any results.
set TheTypedName to (text returned of (display dialog "What’s the name?" default answer "")) as string
GetDetails(TheTypedName)
on GetDetails(who)
set TheRecord to {Mine:{theAddress:"email@hidden", thelink:"http://www.ical.mac.com/jay/jay"}, His:{theAddress:"email@hidden", thelink:"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"}, His:{theAddress:"email@hidden", thelink:"http://www.ical.mac.com/jay/him"}}.” error. Rather fun to read, but kinda disappointing to a young scripter like myself.
TIA anyone...
J.
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
P Please consider the environment before printing this email.
_______________________________________________
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