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:
- Start up Automator, selecting Application for "Choose a template for your workflow".
- Find the Action "Run Shell Script", and drag or double-click to add it.
- For "Pass input" dropdown: choose "As arguments"<-- I think that's the step you are missing.
- For "Shell" dropdown: pick the shell you like (probably /bin/sh, judging by your question).
- 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). - 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
.