• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Couple of Applescript questions....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Couple of Applescript questions.... (From: Robert Nicholson <email@hidden>)

  • Prev by Date: Why doesn't this work in Address Book?
  • Next by Date: Re: Say command using "Organ" doesn't work
  • Previous by thread: Couple of Applescript questions....
  • Next by thread: NSContainerSpecifierError in Address Book
  • Index(es):
    • Date
    • Thread