• 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
Re: Anybody to add only if absent to a group in address book?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anybody to add only if absent to a group in address book?


  • Subject: Re: Anybody to add only if absent to a group in address book?
  • From: John M <email@hidden>
  • Date: Sat, 9 Dec 2006 20:08:58 +0000

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

John Maisey



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden

  • Prev by Date: attachments to Filemaker container
  • Next by Date: Anybody to add only if absent to a group in address book?
  • Previous by thread: Anybody to add only if absent to a group in address book?
  • Next by thread: Anybody to add only if absent to a group in address book?
  • Index(es):
    • Date
    • Thread