Simple Script for URI Handling Basically what I'd like to know is how can I setup a shell script (or an Applescript or Automator wrapper for a shell script) as a protocol handler for a custom URI (so clicking them will trigger my script) with the URI passed in as an argument?

For example, if my URI looked something like:

foo://haravikk.com/request?id=1234&amp;name=bar


How could I setup a shell script on OS X to be triggered any time a URI with protocol "foo" is clicked, and to receive the entire URI as an argument I can then process? I already have the script for processing done, just don't know how to get it triggered in the first place :)
This technique works for me.

Here are some other relevant answers from around Stack Exchange:


Where does Mac OS X store file association information?
How do I configure custom URL handlers on OS X?
How can I manually change default applications in OS X?
How does Mountain Lion set the default text editor for the “open -t” terminal command?
Is it possible to query the launch services database for applications that will open an arbitrary file or UTI type?
How to remove an URL protocol default handler


A couple of relevant utilities are RCDefaultApp and duti.