Skip to content

Instantly share code, notes, and snippets.

@poritsky
Last active December 15, 2015 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poritsky/5200080 to your computer and use it in GitHub Desktop.
Save poritsky/5200080 to your computer and use it in GitHub Desktop.
Add to Mail Rule by Sender (courtesy of Veritrope) Updated to only get address of sender, not name. (e.g. `jerks@address.com` instead of `"Some Jerks" <jerks@address.com>`
tell application "Mail"
set m to (selection)
set s to (extract address from sender of item 1 of m)
set r to rule "Archive"
tell r to make new rule condition at end of rule conditions with properties {rule type:from header, qualifier:does contain value, expression:s}
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment