Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by DS. for OSX Firefox Pass Arguments to Magnet Protocol Handler

I was struggling with the same question. I got it to work, and I think you were missing a small step. Apparently Firefox on Mac, for its "Open With" applications, doesn't pass arguments via command line or environment variables or any other unix-like method. It uses Mac's Launch Services. Automator can translate these to command line arguments. The following works on Snow Leopard:

  1. Start up Automator, selecting Application for "Choose a template for your workflow".
  2. Find the Action "Run Shell Script", and drag or double-click to add it.
  3. For "Pass input" dropdown: choose "As arguments"<-- I think that's the step you are missing.
  4. For "Shell" dropdown: pick the shell you like (probably /bin/sh, judging by your question).
  5. Automator will give you a sample of code, but you'll just want what you already have: transmission-remote -a "$@" (double-quotes allow correct forwarding of arguments that contain spaces).
  6. Save the app.

When Firefox runs this app to open files/downloads, it passes them in Mac's native way, then Automator translates them to shell arguments, and the shell script forwards them to transmission-remote.


Viewing latest article 1
Browse Latest Browse All 2

Trending Articles