I am trying to get a set of Address Book "person" objects for those people with e-mails containing a specific string (e.g. "somedomain.com").
As a proof of concept:
However, this search doesn't work...and I can't figure out why not! I can search for people with "first name" and such, it seems to be related to not correctly be searching into the "emails" collection. "where the value of its first email" does return a result, but isn't functionally what I want to do...
As a proof of concept:
Code:
tell application "Address Book"
repeat with thePerson in (every person where the value of its email contains "somedomain.com")
display dialog "first=" & (first name of thePerson) & " last=" & (last name of thePerson)
end repeat
end tell
However, this search doesn't work...and I can't figure out why not! I can search for people with "first name" and such, it seems to be related to not correctly be searching into the "emails" collection. "where the value of its first email" does return a result, but isn't functionally what I want to do...