I'm trying to register a custom protocol to an application on the Mac, i.e:
I've done this successfully on Windows using the information from this question:
how do I create my own URL protocol? (e.g. so://...)
I would prefer to find something that is browser-independent, in other words at the OS level. I would also like to automate this registration through a shell script, so hopefully there is a way to do this that doesn't involve the GUI.
Thanks!
I've not had occasion to use it, but some time ago I bookmarked OS X URL handler to open links to local files which is exactly what you're looking for.
The important part of the linked procedure is adding an appropriate CFBundleURLTypes
to your application's Info.plist that describes the scheme. The example given there looks like this:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Local File</string>
<key>CFBundleURLSchemes</key>
<array>
<string>local</string>
</array>
</dict>
</array>