Re: Address Book Chat Handles
Re: Address Book Chat Handles
- Subject: Re: Address Book Chat Handles
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 05 Mar 2003 07:33:45 -0800
The IM Handles not properties, they're elements, as you know. As with all
elements on Address Book scripting, you have to say whether you're making
them - at 'end of Yahoo handles' or 'at beginning of Yahoo handles'. It's
just the same for phone (numbers), addresses, and emails.
But the main thing is you're using double braces {{ }}. That makes it a
list of a record, instead of a record. That's why you're getting "error 8".
(This is the worst thing about Address Book scripting: the error messages
are meaningless to scripters.)
tell person 10 of group "Friends"
make new Yahoo handle at end of Yahoo handles with properties
{value:"wonderful", label:"work"}
end tell
This works.
I hadn't seen the class;email thing in properties of MSN handles - thanks -
and I've been extracting MSN handles OK, probably by not getting its
'properties'. I've had to get value and label explicitly, and not set
variables to the handle either, always spell it out:
label of first AIM Handle of person "Whoever"
or
repeat with i from 1 to (count AIM Handles of person "Whoever")
set theLabel to label of AIM Handle i of person "Whoever"
end repeat
Don't 'set theHandle to AIM handle I' and then try to get the value of
'theHandle'. Nuts, isn't it?
--
Paul Berkowitz
>
From: Matt Petrowsky <email@hidden>
>
Date: Wed, 5 Mar 2003 02:21:44 -0800
>
To: AppleScript-Users <email@hidden>
>
Subject: Address Book Chat Handles
>
>
I've read the list archives and Paul Berkowitz has kindly mentioned
>
some of the bugs related to the Address Book.
>
>
My question to the list is if anyone has the proper syntax for adding a
>
chat handle (MSN, Yahoo, ICQ, Jabber, AIM) to a contact record?
>
>
I know you can get it out with
>
>
value of MSN Handle of Person x of group "somegroup"
>
>
and
>
>
properties of Yahoo handle of person 10 of group "Friends"
>
>
will give you...
>
>
{{value:"somename", id:"D780F1AF-4B69-11D7-AD1E-000393D76A82",
>
label:"work", class:Yahoo handle}}
>
>
yet...
>
>
properties of MSN handle of person 10 of group "Friends"
>
>
gives you...
>
>
{{value:"anothername", id:"CD065E40-4B69-11D7-AD1E-000393D76A82",
>
label:"work", class:email}}
>
>
where the class is different (class:Yahoo handle vs. class:email).
>
Obviously, this is one of those bug things. But has anyone gotten a
>
script to work for adding a Handle to an existing record or when making
>
a new record?
>
>
Or am I screwed?
>
>
I've tried
>
>
make new Yahoo handle with properties {{value:"wonderful",
>
label:"work"}} at person 10 of group "Friends"
>
make new Yahoo handle with data "somedata" at person 10 of group
>
"Friends"
>
make new Yahoo handle at person 7 of group "Friends" (hoping for a
>
reference returned - no luck)
>
>
Any help is welcomed.
>
>
Matt Petrowsky
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.