Many applications configure a URL Scheme to allow their users to launch their application using a simple URL instead of manually launching the app. For example, Safari is associated with HTTP and HTTPS, and ITMS is used for iTunes.
Any application can define new URL protocols by including this in their Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>1passwd</string>
<string>onepasswd</string>
</array>
</dict>
</array>
In [1Passwd](http://1passwd.com) we registered 2 schemes, *1passwd://* and *onepasswd://*; this allows us to send emails with links like this:
>
1passwd://ebay.com
When this link is clicked, OS X references the launch services database to determine which application has registered itself to handle this protocol. If you have 1Passwd installed, the above link will launch 1Passwd.
Unfortunately, sometimes the launch services database gets out of sync. I'm not sure how it falls out of sync, but a few customers have reported that clicking the link doesn't work.
To fix this, you can force launch services to rebuild its database; there are several ways to do this.
Most system maintenance tools include tasks for rebuilding the launch service database.
Onyx is a free tool that does the job, and
Cocktail is an inexpensive shareware application that can do the job as well.
If you're the adventurous type, you can rebuild the database your self. Of course you should backup the database first and do your own research (in other words, this information is provided AS IS so don't try to sue me if it does something unexpected).
To rebuild the database yourself, from Terminal run the following command:
/System/Library/Frameworks/ApplicationServices.framework/
Frameworks/LaunchServices.framework/Support/lsregister
-kill -r -domain local -domain system -domain user
All this should be a single line, but was broken up for readability. Here is the same command on one line for copy-n-pasters:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
When I ran this on my machine, the size of the lsregister dump was reduced by 20 percent. This should become a regular maintenance activity to clean up old applications; especially for developers.
### LaunchServices on OS X 10.5 Leopard
On Leopard the LaunchServices framework was moved from the ApplicationServices into the CoreServices framework:
/System/Library/Frameworks/CoreServices.framework/
Frameworks/LaunchServices.framework/Support/lsregister
-kill -r -domain local -domain system -domain user
Again, this should be a single line, but was broken up for readability. For copy-n-pasters:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user