Skip to content

Instantly share code, notes, and snippets.

@benwaldie
Created October 27, 2016 19:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwaldie/e5b3eb9c49e948821aab589b52f9dd6b to your computer and use it in GitHub Desktop.
Save benwaldie/e5b3eb9c49e948821aab589b52f9dd6b to your computer and use it in GitHub Desktop.
Save Selected Mail Message Attachments
set theSavePath to path to desktop folder as string
tell application "Mail"
selection
set theMessage to item 1 of result
set theAttachments to every mail attachment of theMessage
repeat with anAttachment in theAttachments
set theName to name of anAttachment
save anAttachment in file (theSavePath & theName)
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment