tags:

views:

520

answers:

1

I have done it in windows, how do i register a protocol on mac osx. I want to click links in firefox (a href="somename://mylinkAndData") and launch a binary?

+4  A: 

Have a look at Apple's Launch Services Programming Guide. You have to add CFBundleURLTypes to your apps Info.plist and register your app with LSRegisterURL().

Excerpt from Firefox.app/Contents/Info.plist:

    <key>CFBundleURLTypes</key>
    <array>
            <dict>
                    <key>CFBundleURLIconFile</key>
                    <string>document.icns</string>
                    <key>CFBundleURLName</key>
                    <string>http URL</string>
                    <key>CFBundleURLSchemes</key>
                    <array>
                            <string>http</string>
                    </array>
            </dict>
 ....

EDIT: See Handling URL schemes in Cocoa for a how-to article

f3lix