Efficient searching of Address Book
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.