Apple mail script to automatically open & execute .torrent files

Discussion in 'Mac Programming' started by jap4n, Nov 9, 2005.

  1. macrumors member

    Joined:
    Aug 10, 2003
    Location:
    wellington, nz
    #1
    Hi there,

    i'm trying to create an Applescript to automatically open and execute .torrent files.

    This is because sometimes I'm away from my computer at home and want to start a .torrent download immediately. For instance, i might be at work and want to start a .torrent to download at my home.

    So, i was thinking - i could create a rule in Apple Mail to execute an Applescript if a .torrent file was attached to the email. The applescript would then execute the attachment (.torrent file only) of the email.

    Does anyone have any ideas on to go about this? or see any flaws in my approach, or have alternative ideas?

    cheers :)
     
  2. Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #2
    It would be a lot easier to ftp the file over and then ssh into the box and use command line to open it.
     
  3. thread starter macrumors member

    Joined:
    Aug 10, 2003
    Location:
    wellington, nz
    #3
    cool thanks - a bit tricksy.. but all good none the less.

    thanks heaps! :)
     
  4. Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #4
    Assuming the remote computer has SSH capabilities:
    1. Turn on SSH on your computer.
    2. From the remote computer use sftp to transfer the torrent.
    3. From the remote computer, SSH in.
    4. Type: open /path/to/torrent
    5. Done.

    You may need to set up your torrent program to not ask for a download location.

    From your own computer, try step 4 in the terminal. You can see how the file will open up. Your torrent program shouldn't even have to be open.
     
  5. thread starter macrumors member

    Joined:
    Aug 10, 2003
    Location:
    wellington, nz
    #5

    cool.. lucky my trusty flatmate is home, hes opening ftp port to our network and turning on ftp on my g4.

    ive just ssh'd into the network, then connected to my g4 :)

    awesomeness :cool:
     
  6. macrumors newbie

    Joined:
    Jul 22, 2004
    Location:
    California
    #6
    Instead of useing sftp (which can be kinda tricky to use at first). You could alwase use scp, the santax for scp is "scp /path/to/file ip.add.re.ss:/path/on/remote (or just ~ to go to your home dir)" ie scp /Users/Nikore/torrent.torrent 192.168.0.1:~. Then do the rest of other post.
     
  7. macrumors regular

    Joined:
    Jan 14, 2003
    #7
    Similar issue-- I am already using this folder action script to open torrents automatically after download in Safari: http://www.macgeekery.com/tips/open_your_own_safe_files

    I would like to make another script to move torrents automatically to another folder before opening (I would just change the dl folder but I want the torrents to go to a sub folder just for torrents).
     
  8. thread starter macrumors member

    Joined:
    Aug 10, 2003
    Location:
    wellington, nz
    #8
    shouldnt be too hard to edit that script..

    just after the if function - you should be able to add 'move' to directory before the open function?

    not too savvy with applescript atm sorry
     

Share This Page