Use AppleScript and Mail to auto-start torrent downloads

Jun 14, '06 07:30:00AM

Contributed by: mattcomi

Can't download torrents from the office? Find yourself emailing them home so you can start them when you get there? Ever Ever wished your home Mac would just start downloading them straight away? If you answered yes to those questions, then this tip is for you.

You're going to set up an AppleScript Mail filter that picks out attached torrents, and then uses Azureus to download them. First, download the Applescript (8KB) (macosxhints mirror).

Save it somewhere sensible; I chose /Library/Scripts. Next, you'll need to add the rule to Mail. In Mail's Preferences, click Rules then Add Rule. Set up the From and Subject lines as they apply. For instance, my rule checks that From Contains my surname, and that Subject Contains download torrent. As for Perform the Following Actions, select Run AppleScript, and choose the AppleScript you just downloaded. Select OK. You're nearly there...

In Azureus, you'll need to make a slight change: In Options -> Files, you'll find Save to Default Data Directory. Ensure that this checkbox is checked. And there you have it. Enjoy! You can also find these instructions with screenshots here.

[robg adds: In the script mirror on hints, I've commented on one line you'll want to change -- the path to the default save directory. This hint is interesting not just for the stated purpose, but as an example of using AppleScript and Mail's rules to automatically handle inbound attachments.]

Comments (18)


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