• 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
Address Book->check for existing record before adding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Address Book->check for existing record before adding
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Re: X10 Commands
  • Next by Date: Re: Address Book->check for existing record before adding
  • Previous by thread: Re: speedup scripts redux
  • Next by thread: Re: Address Book->check for existing record before adding
  • Index(es):
    • Date
    • Thread