• Home
  • Directory
  • Geeky Fun
  • Answers
  • MakeUseOf Guides
RSS Twitter Facebook
Subscribe to MakeUseOf. Now, 183511 members!
Aweber

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

By Jackson Chung on Dec. 31st, 2009

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:

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.

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.

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.

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!

(By) Jackson Chung is the Assistant Editor for MakeUseOf

Enjoyed the article? Subscribe to MakeUseOf to get daily updates on new cool websites and programs in your email for free. You'll also get free printable cheat sheets to your favorite programs

Your Email:

Similar Articles

  • 9 Greasemonkey Scripts To Get More Productive While Searching Google
  • BumpTop – Gives Your Mac Desktop A Real 3D Look
  • Deluge – An Awesome But Unappreciated Cross-Platform BitTorrent Client
  • 3 Easy-To-Create Simple Automator Workflows For Everyday Use
  • How To Run Multiple Dropbox Accounts Simultaneously [Mac]
  • Running Windows Programs on Your Mac using WineBottler
  • 6 Beginner Resources For Learning Mac Programming
  • How To Change The Default Screenshot Image Format & Other Properties [Mac]
More about: apple mail . applescript . mac hacks . scripts . torrent . torrent clients . utorrent

6 Comments

2010-01-01 01:06:44
Andrew Littler
Subscribed to comments via email

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

Reply to this comment
2010-01-02 04:03:36
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?

Reply to this comment
2010-01-01 09:13:23
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.

Reply to this comment
2010-01-02 04:02:43
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.

Reply to this comment
2010-01-03 04:05:46
jack

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

Reply to this comment
2010-03-02 19:07:22
Daniel
Subscribed to comments via email

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.

Reply to this comment
Reply
Note: Comments with abusive content, sarcastic grammar nitpicking, self-promotion will not be published. All comments are moderated.
Click here to cancel "reply".

TopicsMUO Guides
  • Browsing
  • Cool Software
  • Web Apps
  • Lists of Tools
  • How-To Tips
  • Windows
  • Mac
  • Linux
  • Gaming
  • Mobile Apps
  • Polls
  • Geeky Fun
  • BitTorrentThe Easy Guide
  • iPhoneUnofficial Manual
  • ItunesThe Big Book
  • LinuxGetting Started
  • MacBeginner's Guide
  • MoviesFor Movie Addicts
  • PC BuildingThe Idiot's Guide
  • ProductivityProductivity Guide
  • PhotoshopThe Idiot's Guide
  • TwitterBest Tips & Tricks
  • More Guides
Follow us on Twitter
Be Our Friend on Facebook
MakeUseOf Staff
Editors:
  • Editor in ChiefAibek Esengulov
  • MakeUseOf Directory's EditorKaly
  • Managing EditorMark O'Neill
  • Assistant EditorJackson Chung
  • MUO WP GuyJorge Sierra
  • PDF ManualsSimon Slangen
  • Promotion & SEORyan Dube
  • Sys AdminKarl Gechlik
  • MakeUseOf NewsletterSaikat Basu
  • MakeUseOf Answers EditorTina Sieber
Staff Authors:
  • ( Ask The Admin )Karl Gechlik
  • Tina Sieber
  • ( Tech Crazy )Varun Kashyap
  • ( The Things I Do )Saikat Basu
  • ( simonslangen.com )Simon Slangen
  • ( Free Writing Center )Ryan Dube
  • ( Super Subconscious)Jeffry Thurana
  • ( Tapping Thought )Dean Sherwin
  • ( Mac Photography Tips )Bakari Chavanu
  • ( timmyjohnboy.com )Tim Lenahan
  • ( Boulder Community Computers )Justin Pot
  • ( Social Branding Blog )Steven Campbell
  • Other Active Authors ...

 

© 2010 MakeUseOf . Designed by kailoon AboutContactSubmit AppWrite For UsArchivesMobile VersionDisclaimer visitor stats