I would like a specific URL scheme, magnet:, to run a command in Terminal.

For example:


Would execute:

myCommand "magnet:?xt=urn:bKKH"
  • 2
    There is no way typing e.g. magnet:?xt=urn:bKKH in a Terminal is gong to do anything other then -bash: magnet:?xt=urn:bKKH: command not found unless you actually have an executable named e.g. magnet:?xt=urn:bKKH. That said, I see you have an "automator" tag set so if Automator is involved, or not, I think you need to clarify what you're asking for and in what context. Aug 18, 2015 at 16:39
  • 1
    I think there was a misunderstanding. I won't type magnet in my terminal, I will click on a magnet link on my browser.
    – nute
    Aug 19, 2015 at 6:45
  • This Super User post might be helpful.
    – aaplmath
    Aug 21, 2015 at 20:11

1 Answer 1


I found my answer using AppleScript:


  • Create an AppleScript that uses on open location this_URL
  • Save as Application
  • Edit the Info.plist of the Application with:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .