67
36
I've been reading a lot online about custom URL handlers / custom protocol handlers such as:
- Launching External Applications using Custom Protocols under OSX
- OS X URL handler to open links to local files
I get that you can tell the system that a particular program is able to handle a certain scheme / protocol with the Info.plist
file:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Local File</string>
<key>CFBundleURLSchemes</key>
<array>
<string>local</string>
</array>
</dict>
</array>
<key>NSUIElement</key>
<true/>
But if there are multiple applications that are capable of opening the same URL handler, such as mailto:
how do you specify which one you want the system to use?
There were some references to utilities like the More Internet preference pane
which no longer seems to be available from the author's site. I did find it online by Googling but it seems a bit shaky - like it was written for an older OSX - perhaps Tiger.
I haven't been able to find information on how to set the URL handler for protocols and custom protocols. I'm assuming there is a plist
file somewhere that I can edit - or maybe there is a newer, better utility that works well with Mountain Lion?
This seems to be to open a real "app". What if I want to do some custom processing, using a terminal command, etc? – nute – 2015-08-25T07:57:00.703
1@nute Just from the top of my head, not sure. Perhaps an app created with Automator that wraps a shell script? – slhck – 2015-08-25T11:17:42.950
How can I receive input in the automator? Like, the content of the URL? – nute – 2015-08-25T11:30:46.780
I found my answer using AppleScript (https://support.shotgunsoftware.com/entries/127152-Launching-External-Applications-using-Custom-Protocols-under-OSX)
– nute – 2015-08-25T12:42:23.477Just a note, if you have multiple apps/app-versions handling the same protocol (e.g. IntelliJ EAP, IntelliJ), you can choose the specific one to use in the the
Apps
tab inRCDefaultApp
. It is still working for me in macOS 10.11. – vaughan – 2016-06-14T03:24:16.917May need to revise the answer since the image 1st image is missing and the 2nd image code has been reassigned to a completely irrelevant image – MrU – 2016-07-29T02:22:25.740
@MrU Not sure what you're talking about – the post shows like this for me: http://imgur.com/a/4o7fZ
– slhck – 2016-07-29T07:49:37.900@slhck Wierd... I'm recieving a 404 image, and an image related to the Akinator.... – Looking in the post's details here are the links that I'm getting. 404 – http://i.stack.imgur.com/HVCo2.png | Akinator – http://i.stack.imgur.com/S9xqn.png
– MrU – 2016-07-30T07:57:21.560@MrU I suppose your ISP or another entity is messing with your Internet access? – slhck – 2016-07-31T09:20:03.913
364 minutes 19 seconds? Seriously? – Daniel Beck – 2013-02-07T21:00:15.487
2Thanks for the fast and detailed answer. Looks good! Question though - I think that I tried RCDefaultApp before and had some issue with it. Has it been working seamlessly for you? – cwd – 2013-02-07T21:06:34.697
@cwd I honestly have to say I don't use it often. More for screenshots for Super User than anything else :) Whenever I need to change file associations I do it through the Get Info… dialog in Finder. I never needed to change protocol and MIME handlers. But it seemed stable enough for me. – slhck – 2013-02-07T21:09:43.107