How To Remotely Trigger A Torrent Download Via Email [Mac]

launch transmission   How To Remotely Trigger A Torrent Download Via Email [Mac]For a long time now, I’ve been searching for a way to start a torrent download from a remote location. And since I’m on the road most of the day, Transmission’s WebUI isn’t any good to me. I couldn’t be bothered to set it up anyway, it would involve having a fixed IP address or DynDNS — too much hassle to being with. What I actually needed was a simple way to download a torrent on my iPhone and send it to my Mac running at home.

When I realised that the iPhone didn’t support downloading files natively, I was back to square one. Then I thought of using Dropbox — but that didn’t work. After a couple of hours of research, I finally found a solution, albeit a pretty rudimentary one. It involves a secondary email, Mail rules, Transmission or uTorrent and Applescript. Now, let’s be clear on this: I’m not a scripting geek. I’m just an average Mac user. But the fact that I actually wrote this script is a clear testament to how easy it is to learn the Applescript language. I digressed.

Here’s how I managed to set up Mail and Transmission to automatically download torrents sent via email.

First of all, we need to write the script. But since this is MakeUseOf, I’ve already written it for you. Download the appropriate version depending on which torrent client you use.

Download Applescript: Transmission via email

Download Applescript: uTorrent via email

Unzip the file and store the script somewhere safe, for example within the scripts folder located at /Library/Scripts/.

If you prefer to compile the script yourself, here’s how it looks like:

(*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

Before we proceed, let me explain that we are going to set a rule to detect torrents sent from a primary email to a secondary email. So in this case, you’ll need to 2 separate email accounts.

Now launch Mail (assuming you inherently use Mail; if not, you’re out of luck) and enter its Preferences. Click on the Rules tab and add a new rule. Name it “Torrent“, then set the condition to “all”, as in “If all of the following conditions are met”. Next, set the rule conditions as you see in the screenshot below:

mail rule   How To Remotely Trigger A Torrent Download Via Email [Mac]

From – is equal to – your@emailaddress.com
Subject – is equal to – Download torrent

Perform the following actions:

Mark as Read
Run Applescript – Click the choose button and locate the Applescript you’ve just downloaded

Click on OK and click on “Don’t Apply” if asked Do you want to apply your rules to messages in selected mailboxes?

Mail is now set. For every email from your@emailaddress.com with the subject “Download torrent”, it will trigger the Applescript. Perfect, just what we want.

Now, let’s set Transmission. Enter its Preferences and check the box for “Start transfers when added” and make sure to uncheck “Display “adding transfer” options window”. We want Transmission to automatically start torrents without intervention. OK, Transmission is now set as well.

transmission settings   How To Remotely Trigger A Torrent Download Via Email [Mac]

uTorrent’s default settings will do just fine.

Now then comes the interesting part. How do we format the email? It’s pretty simple. The Applescript is set to copy the content of the message so all you need to add is the URL to the torrent. Remove your email signature or it won’t work. From my iPhone, all I do is hold down on a link until the contextual menu appears. I tap on Copy and launch Mail on my iPhone.

   How To Remotely Trigger A Torrent Download Via Email [Mac]

Select the appropriate mailbox corresponding to your@emailaddress.com and compose a new message to your secondary email account my@emailaddress.com. Enter the subject line: Download torrent — remember that’s one of the triggers.

Then paste the torrent URL into the content of the message and remove everything else i.e. signatures, etc. Click Send and watch the magic happen.

   How To Remotely Trigger A Torrent Download Via Email [Mac]

As soon as your Mac receives the email, it will:

    *Mark it as read;
    *Start the Applescript which then;
    *Launches Transmission or uTorrent;
    *Opens a torrent location from a URL;
    *Enters the URL into the field and clicks OK;
    *Starts downloading the torrent.

Since all of the magic happens from within your Mac, it doesn’t really matter how you send the email. Happily, you can do this from any mobile phone with internet connectivity, or from a browser. I hope you’ll find this “hack” useful.

This is my last post of the year before I take a short break from writing. I wish all MakeUseOf readers a Happy New Year!

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

13 Comments -

0 votes

Andrew Littler

I was looking for this kind of thing for AGES, but then I found a very simple way (at least on the Mac) with TweetMyMac (http://bit.ly/2Pj55X or http://tweetmymac.com), where you just Tweet a Terminal-esque command for it to send back to your computer

ie: torrent http://isohunt.com/torrent_details/79325381/game+of+thrones?tab=summary

you can even use it to shut down/ log off/ sleep/ record ip/ screenshot/ ichat and Tweet back respective photos

0 votes

Jackson Chung

That would mean that your followers would know what you’re downloading or you’d need to create a new Twitter account, wouldn’ it?

0 votes

Robert M

I’ve seen tutorials (heh, maybe on this site) where people trigger torrents by having two devices sharing a folder via Dropbox.

You simple make a new folder in the dropbox folder, name it torrents, and tell your uTorrent client to automatically load torrents from that folder. So when you’re away, all you have to do with your laptop/mobile device is save torrents to that folder.

0 votes

Jackson Chung

Yup, you could make Transmission monitor a folder provided you can download the torrent, which you can’t do with the iPhone. Hence this method.

0 votes

jack

What a great method. I wish you had something similar for pc as I’m looking fir the same thing with my iPhone.

0 votes

Daniel

I have an easier way for you all

All you need is dropbox and tramission.

In your Tramission setup select your dropbox folder as the folder tranmission watches for torrents.

Then simply use the dropbox web interface to drop torrents into your dropbox folder. Transmission will automatically start the download as soon as the torrent hits the dropbox folder.

The great thing is all you need is a computer with a browswer to remotely start torrents.