Retrieve a Remote File - by Email
Saturday, February 16th, 2008
If you’re using an iPhone or a touch or some other mobile device this could be a very convenient way to retrieve a file from home and view it on your device.
Here’s the scenario: You’re on the bus, you realize your French homework is sitting at home on your Mac. Send yourself a text message with the path to the file. By the time you get to school and log on to a computer your file has been emailed. Problem solved.
Configure Murphy’s script to run every so often using something like launchd. Then send yourself an email. Include the path to the file you want sent in the body, like this:
/Users/murphy/Documents/PenskeFile.doc.
Mail will create a new message, attach the file, and send it to the address in the script. You can configure the script to run when a certain word is in the email subject, like FileGrab. This is an ideal use for rules in Mail.app. But rules don’t seem to work in Mail as of 10.5.1. Murphy hasn’t tried 10.5.2 yet.
Update: If you leave the file name out the folder’s contents will be zipped and sent.
Instead of using rules, this script is written to run periodically. Maybe every ten minutes or so. If it sees an email with the keyword in the subject it checks for the file and sends it. If the file doesn’t exist the script sends an email that says so.

Security hole? Well, Murphy doesn’t think so. The file will only be mailed to the address you specify in the script, it’s not a reply. (you could alter the script to have it reply, but that doesn’t seem like a good idea.) You can use secure email to send the request and the file. That’s secure.
Getting back to the mobile devices: Your unhacked iPhone and touch don’t let you download files. So you can’t SSH back to the house and grab the file. You could set up your Mac as a web server, but I wouldn’t want to do that.
Using this script the file is emailed to you, so you can view it in Mobile Mail or Gmail depending on what kind of file it is. You can easily view the file later, when you’re offline. The catch? You need to know the path to the file you’re retrieving. Don’t know the path? Here’s some help.
Windows Users: Have a look here.
Note: Script requires use of Mail.app. To schedule this script to run on a schedule you might want to try something like lingon for editing your launchd configuration.
Other Murphy scripts for working with Mail:
Sleep Your Mac by Email
Select a Playlist by Email
Get a List of Your Files by Email
Retrieve Mail.app Messages by Text Message (this post shows how to match emails with Applescript using multiple criteria)
Murphy has been on the lookout for an easy way to use the Quick Add feature of Google Calendar, even when his calendar isn’t open in Safari or Firefox. There doesn’t seem to be a widget, but there is a 




