• 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: Adding a SENDER to a Group RULE in Apple Mail 2.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding a SENDER to a Group RULE in Apple Mail 2.1


  • Subject: Re: Adding a SENDER to a Group RULE in Apple Mail 2.1
  • From: Michelle Steiner <email@hidden>
  • Date: Wed, 7 May 2008 09:25:40 -0700

On May 7, 2008, at 9:19 AM, Don Wieland wrote:

To my surprise, there is no obvious way to add a sender to a group via a RULE in Apple Mail.

I submitted that as a feature request to bugreport a few years ago, but they closed it without any action.


Is there an Applescript that will help me in this situation?


Actually, there is; I wrote one shortly after submitting that bug report. Here it is:

using terms from application "Mail"
	on perform mail action with messages theMessages ¬
		for rule theRule
		tell application "Mail"
			repeat with thisMessage in theMessages
				set sender_ to sender of thisMessage
				set name_ to extract name from sender_
				set address_ to extract address from sender_
				set fn to first word of name_
				set |ln| to last word of name_
				tell application "Address Book"
					set new_contact to make new person
					tell new_contact
						set first name to fn
						set last name to |ln|
						make new email at beginning of emails ¬
							with properties ¬
							{label:"Vacation", value:address_}
					end tell
					add new_contact to group "vacation"
					save addressbook
				end tell
			end repeat
		end tell
	end perform mail action with messages
end using terms from

--
Homosexuals do not recruit; Christians recruit, and so does the military.


_______________________________________________
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/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Adding a SENDER to a Group RULE in Apple Mail 2.1
      • From: Don Wieland <email@hidden>
References: 
 >Moving newly created email (From: Duncan McGregor <email@hidden>)
 >Re: Moving newly created email (From: Axel Luttgens <email@hidden>)
 >Adding a SENDER to a Group RULE in Apple Mail 2.1 (From: Don Wieland <email@hidden>)

  • Prev by Date: Re: How to maximize Safari windows?
  • Next by Date: Re: How to maximize Safari windows?
  • Previous by thread: Adding a SENDER to a Group RULE in Apple Mail 2.1
  • Next by thread: Re: Adding a SENDER to a Group RULE in Apple Mail 2.1
  • Index(es):
    • Date
    • Thread