Created
February 13, 2012 10:32
-
-
Save rymawby/1815848 to your computer and use it in GitHub Desktop.
Saving selected mail attachments for use with a Dropbox gallery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Mail" | |
set theSelectedMessages to selection | |
repeat with theMessage in theSelectedMessages | |
repeat with theAttachment in theMessage's mail attachments | |
set thePath to "/Users/user/Dropbox/Photos/CheekyMonkey/" | |
set posixPath to POSIX file thePath as string | |
set theSubject to theMessage's subject | |
set theAttachmentFileName to posixPath & theSubject & theAttachment's id & theAttachment's name | |
try | |
save theAttachment in theAttachmentFileName | |
on error errnum | |
end try | |
end repeat | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment