Tag Archives: Dropbox

AppleScript IOS

Email Attachment to Dropbox

Unlike Box.net and Evernote Dropbox does not currently allow you to email a files to your account.

There is at least one service that providers this functionality but I prefer not to involve third parties with my data where I can avoid it.

Credit must go to the person who wrote this script (can’t seem to find where I found it) but with some slight modifications I can now send a file to Dropbox by emailing it to a nominated personal email account.

In Mail I have a rule that runs for on a particular account that will call this script when a new message arrives. The script will save a copy of any attachments to my local Dropbox folder (in this case a called Attachments), within seconds the file will be synced to my online Dropbox account. This enables me then to open the file from one of my IOS apps.

Simple but very effective. Here is the code;

**********

using terms from application “Mail”

on perform mail action with messages theMessages for rule theRule

tell application “Mail”

repeat with oneMessage in theMessages

set {mail attachment:theAttachments} to oneMessage

repeat with oneAttachment in mail attachments of oneMessage

save oneAttachment in (“(your Hard Drive name):Users:(your user name):Dropbox:Attachments”;) & (name of oneAttachment)

end repeat

end repeat

end tell

end perform mail action with messages

end using terms from