Re: Programming the address book
Re: Programming the address book
- Subject: Re: Programming the address book
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 26 Oct 2003 14:29:14 -0800
On 10/26/03 1:47 PM, "Michelle Steiner" <email@hidden> wrote:
>
The "name" property is read only; you have to parse first name, last
>
name, middle name (if any), and suffix (if any).
It's a little more complicated than that. In Panther, if there's both a
first and last name, then you have to tack on 'title' plus " " if there's a
title, insert " " & middle name & " " if there's a middle name, and append
" " & suffix if there's a suffix. (This doesn't apply in Jaguar.) If
there's not both a first and last name, then 'name' is whichever one exists,
with nothing tacked on, not even middle name if it exists (that one just
caught me). If there's neither first nor last name, then it's nickname, if
it exists; if no nickname, then company. (Also if you've marked the contact
as "Company" even if it does have first or last name.) If no company, then
the first email address If no email address, then the first AIM name (but
not any other IM name if there's no AIM name). It's absurdly complicated.
Only if NONE of these is non-empty do you get a <No Name> in the UI, which
is "" (NOT 'missing value') for 'name' in AppleScript.
Finally, you will error on many of these if you go looking for them as
properties of the person and they're empty. You still have to look for them
as labels of the record 'properties' of the person for many of them,
although that bug has been fixed for some of the individual properties! And
lastly, the error won't come immediately when setting a variable, or just
getting, one of these non-evaluated empty properties, only when next try to
use it, so if you use a try block you need to get the variable you've just
set to provoke the error. better just to get 'properties' property where all
the empty values will be 'missing value'.
>
In mail.app, "sender"
>
is plain text. This means you can not simply plug in the name of a
>
sender into a new person in the address book, but have to parse the
>
sender text.
>
>
This is easy if there's only one or two parts to the name, but what
>
about a three-element name? is it first, middle, last, or is it first,
>
last, suffix? (I'm ignoring for the moment senders such as "Doe, John
>
H."
>
>
I can parse this stuff, making certain assumptions, but isn't there an
>
easier way? If not, shouldn't there be?
>
>
Do the Address Book and Mail.app scripting implementors talk to each
>
other?
Hmmm.
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.