Re: Contacts whose email clauses in Entourage X
Re: Contacts whose email clauses in Entourage X
- Subject: Re: Contacts whose email clauses in Entourage X
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 15 Nov 2004 18:01:16 -0800
On 11/15/04 4:08 PM, "Jeff Porten" <email@hidden> wrote:
> First of all, apologies because I'm sure this answer is already in the
> wild, I just can't find it in my archives or Google.
>
> I have an Entourage database (X, NOT 2004) of incoming emails which
> I've redirected or imported from Mail.app. The automatic linking of
> messages feature is sporadic on these, so I need an AppleScript that
> will link the messages to the contacts. (Whole point of moving this to
> Entourage is to get better handling ability for my email store.)
>
> As of yesterday, the following script line was working:
>
> set linkto to (contacts whose contents of email address 1 is (eachaddr
> as string))
I don't believe it. (Except maybe if it was on a test database, where every
contact had an email address.)
>
> Today, that fails with "Can't get every contact whose contents of email
> address 1 = "email@hidden"."
The problem is that 1) email address is an element, not a property, of
contact. Generally, though not absolutely, 'whose' clauses are implemented
to work on properties, not elements. (They _can_ be: I think Apple's Address
Book can do something like this.) 2) As soon as you have even one contact
with no email address 1, this is going to error anyway.
It may be that Entourage tries to coerce 'email address 1' to a sort of
'email address' property, and can do a whose clause on it. But when it hits
a contact with no email address - error. (That's why maybe if you used it on
a test database where all the contacts had email addresses, it might have
worked there. I don't have time to check just now.)
>
> Since email addresses returns a list of strings, I've tried contains
> clauses, with and without the contents of, with and without "of it"s,
> and I can't get this to work. Obviously, what would be preferable here
> would be finding ANY email address of any contact.
'email address' returns 'contents of email address'(i.e. is coerced to the
contents string property) when a different property (e.g. label, or
'properties) is not called, but that's not the problem here. See above.
Fortunately for you, there's a much better and faster way of doing this,
which will even return every contact that has that email address as _any_ of
its email addresses, just as you want. I guess you didn't notice it in the
Dictionary:
find "email@hidden"
--> list of all contacts with that address, or {} if none
--
Paul Berkowitz
_______________________________________________
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