Re: Couple of Applescript questions....
Re: Couple of Applescript questions....
- Subject: Re: Couple of Applescript questions....
- From: kai <email@hidden>
- Date: Sun, 19 Mar 2006 04:22:06 +0000
On 19 Mar 2006, at 01:59, Robert Nicholson wrote:
... I want to do an add to list operation but only if the item
isn't already on the list. In Applescript is this an expensive
operation? The applescript dictionary for Address Book doesn't seem
to offer this operation so I'd have to do a linear search before
adding an entry to this list. I'm guessing this is expensive. Is
there any way for this operation to be fast?
All contacts in this group have their Email's "other" set to their
valid email address. No other contact field data is set.
You should be able to do some filtering, Robert - perhaps something
like this:
-------------
set whiteList to {"email@hidden", ¬
"email@hidden", "email@hidden", ¬
"email@hidden", "email@hidden"}
tell application "Address Book"
tell group "whitelist" to repeat with p in whiteList
if not (exists (some person whose name is p)) then ¬
tell (make new person) to make new email ¬
with properties {label:"other", value:p}
end repeat
save addressbook
end tell
-------------
---
kai
_______________________________________________
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