Remotely trigger torrent downloads via email from iPhone

Jan 13, '10 07:30:00AM

Contributed by: jacksonchung

I've tried to search the internet for a way to remotely trigger a torrent download from my iPhone, but there wasn't one. So I came up with this solution, which uses two different email accounts (one to send, another to receive), an iPhone, Mail, AppleScript and Transmission.

Note that this was originally published here, but I am the author of the hint. I thought this hint was necessary as the iPhone isn't capable of downloading and attaching torrent files to email messages, as is described in this older hint.

The idea behind this hint is very simple:

What the AppleScript does is copy the URL in the body of the email message, launches Transmission/uTorrent, opens the URL, and starts the download.

Get the script from the original blog post above, or paste it in AppleScript Editor yourself using this code:

(*Transmission via email by Jackson Chung*)
using terms from application "Mail"
  on perform mail action with messages theMessages for rule Torrent
    tell application "Mail"
      repeat with theMessage in theMessages
        set theText to content of theMessage
        set the clipboard to (theText)
      end repeat
    end tell
    tell application "Transmission" to activate
    tell application "System Events"
      tell process "Transmission"
        keystroke "u" using {command down}
        keystroke (theText)
        key code 36
      end tell
    end tell
  end perform mail action with messages
end using terms from
Save the script somewhere safe, like /Library/Scripts or your user's Library/Scripts folder. The next step is to create the Rule in Mail. This is more or less up to you, but here's how I set mine up: Don't forget to make sure that all conditions are met.

Transmission needs to be configured so that downloads start automatically, and make sure to uncheck 'Display "adding transfer" options window,' or it won't begin. uTorrent's default settings work fine.

When sending the torrent URL on your iPhone, remove the email signature from the message. The script copies the entire content of the body and pastes it into Transmission's (uTorrent's) 'Open Torrent Address' field.

Comments (12)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20100108083308321