Skip to content

Instantly share code, notes, and snippets.

@poritsky
Last active December 15, 2015 09:19
Show Gist options
  • Save poritsky/5238032 to your computer and use it in GitHub Desktop.
Save poritsky/5238032 to your computer and use it in GitHub Desktop.
Gathers list of expressions in Apple Mail rules, which in my use simply gathers a list of email addresses, then formats them into a procmail rule.
set l to {}
set r to "Archive" --Apple Mail Rule from which to pull addresses
set f to "Archive" --Name of folder to move messages from sender to
tell application "Mail"
set m to properties of rule conditions of rule r
repeat with v in m
set p to the expression of v
set l to l & ".*" & p & "|" as list
end repeat
end tell
return ":0:" & "
" & "* ^From:" & l & "
" & "." & f & "/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment