• 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
Efficient searching of Address Book
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Efficient searching of Address Book


  • Subject: Efficient searching of Address Book
  • From: Lachlan Deck <email@hidden>
  • Date: Thu, 12 Feb 2004 10:47:21 +1100

Hi all,

I'm trying to figure out how I might make the following method far more efficient than it is. It averages about 8 seconds to look up the name of a person who has, as one of their emails, the given email address anEmail. Here's the method...

on getNameFromEmail(anEmail)
tell application "Address Book"
repeat with eachPerson in every person
set theName to name of eachPerson
repeat with eachMail in (properties of email in eachPerson) as list
if (eachMail contains {value:anEmail}) then
return theName
end if
end repeat
end repeat
end tell
return null
end getNameFromEmail

I've tried fiddling with statements such as the following - but they get a runtime error.
set thePersons to every person whose email contact info contains {value:anEmail}

Any ideas?
Cheers...

with regards,

--
Lachlan Deck
email@hidden
_______________________________________________
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: Efficient searching of Address Book
      • From: Graff <email@hidden>
    • Re: Efficient searching of Address Book
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Error in the Finder
  • Next by Date: Re: Colonic irrigation (OS X)
  • Previous by thread: Re: Colonic irrigation (OS X)
  • Next by thread: Re: Efficient searching of Address Book
  • Index(es):
    • Date
    • Thread