How do I open magnet links in Firefox with a command line app, namely transmission-remote?
I think I need to make a packaged app that accepts arguments, and here's what I did so far:
Use Automator to run a shell script with the following:
transmission-remote -a $@
Save the Automator script as Transmission.app
- Choose Transmission.app in Firefox when using it for magnet links
However, pass arguments to this requires:
open Transmission.app --args magnet:etc
I assume Firefox is doing something like:
Transmission.app %s, but I can't tell how Firefox is passing arguments to the helper app. I've also tried creating a wrapper shell script and naming it
helper.app to no avail.
Alternatively, can Firefox use something like this as a protocol handler, where I can pass in %s?
open Transmission.app --args %s
EDIT: DS answer apparently works on Snow Leopard and Lion, but I'm still problems with blank arguments being sent from Firefox. I'll paste my comment here too:
I've tried the following but only blanks are sent: echo "$@" >> ~/somefile and echo "$*" >> ~/somefile with and without quotes. Perhaps it is my Firefox settings (about:config?). I'm on 19.0.2 (latest), OSX 10.8.2 in case anybody else chimes in...