Address Book->check for existing record before adding
Address Book->check for existing record before adding
- Subject: Address Book->check for existing record before adding
- From: Matthew Galaher <email@hidden>
- Date: Fri, 17 Oct 2003 12:39:51 -0700
I am working on a script that so far uses a loop through every record
to check that I am not making a duplicate record by adding a new
contact through a script. This is mind numbingly slow. I first tried
something like "person whose email is "email@hidden" but I could not get
this to work. What I have so far follows, but I'm wondering if any one
has a suggestion for better i.e. faster way to approach this.
Thanks in advance.
on doesEmailExists(emailAddress)
tell application "Address Book"
activate
set ID_List to (id of people)
repeat with anID in ID_List
--NOT DONE--
try
set emailList to the emails of person id anID
repeat with anEmailAddress in emailList
if emailAddress is equal to anEmailAddress then
display dialog emailAddress & " and " & anEmailAddress & " are
the same"
end if
end repeat
on error
display dialog "error"
end try
--NOT DONE--
end repeat
end tell
end doesEmailExists
_______________________________________________
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.