Hi Robert,
You could make the emails of the group into a list and then compare the sender's email with it.
Something like this:
tell application "Mail" to set thisEmailAddress to extract address from (sender of item 1 of (get selection))
tell application "Address Book" set myGroup to "Group Name" -- Your group name set theEmailLists to value of emails of people of group myGroup set theEmailsOfThisGroup to {} repeat with thisSet in theEmailLists set theEmailsOfThisGroup to theEmailsOfThisGroup & thisSet end repeat if theEmailsOfThisGroup contains thisEmailAddress then display dialog "it's there" else display dialog "it's not there" -- Check for the email in all people and make a new person if need be. -- add this person to the group. end if end tell
Best wishes |