Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(*
Torrent Forwarder by Henrik Nyh <http://henrik.nyh.se> 2008-01-26.
Free to modify and redistribute with credit.

Attach as a Folder Action to your Downloads folder.

When you save a .torrent file, it's sent over scp to a folder on another networked computer, where you are expected to have set up Transmission (http://www.transmissionbt.com/) to check for new torrents.

The local .torrent file is then removed, and Clutch (http://clutchbt.com/) is opened.
*)

on adding folder items to thisFolder after receiving addedItems
  
  repeat with anItem in addedItems
    set thePath to (POSIX path of (anItem as alias))
    if thePath does not end with ".torrent" then
      next
    end if
    set quotedPath to (quoted form of thePath)
    do shell script "scp " & quotedPath & " hyper:" & (quoted form of "Public/Torrent\\ drop") -- scp requires spaces to be escaped (double-escaped here since they're in a string) AND the path quoted.
    
    do shell script "rm -f " & quotedPath
    do shell script "open http://torrent"
  end repeat
  
end adding folder items to