Skip to content

Instantly share code, notes, and snippets.

@poritsky
Last active December 15, 2015 04:18
Show Gist options
  • 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. `[email protected]` instead of `"Some Jerks" <[email protected]>`
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