Re: Variable to an application keyword
Re: Variable to an application keyword
- Subject: Re: Variable to an application keyword
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 20 Aug 2001 19:09:16 -0700
On 8/20/01 5:50 PM, "Greg Back" <email@hidden> wrote:
>
I know this isn't exactly what you are asking about, but you could use
>
>
if search_method is "Description" then
>
set rezults to (contacts whose description contains search_criteria) as
>
else if search_method is "Display Name" then
>
set rezults to (contacts whose display name contains search_criteria)
>
else
>
set rezults to (contacts whose company contains search_criteria)
>
set rezults to rezults as list
>
--Note: I don't know if "Display Name" is a property of contact (I didn't
>
see it in the dictionary of OE 4.5
No it isn't. It's only a property of address of address of recipient, or of
email address of contact (which is of the class 'address'). But since email
addresses of contact are separate elements, not a single property, you can't
use a whose clause. I suppose you should be able to do
set rezults to (contacts whose display name of default email address
contains search_criteria)
but there's a limitation or bug: you can't. However you don't have to: as
Greg says, use 'name':
set rezults to (contacts whose name contains search_criteria)
>
'name' is how you see it in the Contact box or Address Book. It's one of the
ways by which you can specify a contact (see 'application': Elements:
'contact'; 'by name', etc.). That way you don't have to mess about with
figuring out what to do if there's no first name or last name as you would
if you tried to use those contact properties.
You can't coerce a string to any of the application keywords you want here,
not even via 'run script', since they are not properties of the application
but of the contact, and you can't specify a contact to whom these properties
belong until you actually find the contacts by the whose clause. Catch 22.
So Greg's method of setting a parallel application keyword to the selected
string is the correct one. If you want to allow for every contact property
as a search method, you're better off to prepare a handler along those
lines, that you can use it again in future scripts.
--
Paul Berkowitz