Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: Rebuild the launchservices database System 10.5
It happens now and then that when you control-click on a file to use the Open With contextual menu, you'll see double entries, and even removed applications, in the list of available applicatiopns. A rebuild of the LaunchServices database is then the solution. (This also happened in Tiger.)

The path to the lsregister command needed for the rebuild has changed in 10.5. As such, the following command rebuilds the database on Leopard: [robg adds: If you find this happening a lot on your machine, you'll probably find it much simpler to put an alias in your .profile file. You need to create the file in your user's home directory (in Terminal), and a simple way to do that is by typing pico .profile. Then type alias lsrebuild='' into the editor window. Position the cursor between the quotes, paste in the line above, and then save and quit by typing Control-X, Y (to save changes), and pressing Return. Open a new window, and you'll be able to just type lsrebuild to rebuild the database. Feel free to change lsrebuild to whatever name you'd like to use.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[17,732 views]  

10.5: Rebuild the launchservices database | 5 comments | Create New Account
Click here to return to the '10.5: Rebuild the launchservices database' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: Rebuild the launchservices database
Authored by: club60.org on Thu, Nov 15 2007 at 8:14AM PST
It appears that these ghost entries are just copies of your applications in your Time Machine Backup. Great hint, it will help a lot before Apple resolves this issue.

[ Reply to This | # ]
10.5: Rebuild the launchservices database
Authored by: fds on Thu, Nov 15 2007 at 8:40AM PST
"now and then" happens when you browse to the Time Machine backup of your applications.
So avoid looking at /Applications in Time Machine if you want to avoid having to rebuild your LS database.

[ Reply to This | # ]
TinkerTool System got the job done
Authored by: alec kinnear on Sun, Jun 8 2008 at 5:45AM PDT
I couldn't get this command to run successfully from the command line even using sudo.

Happily enough TinkerTool System from Marcel Bresink includes a rebuild Launch Services feature User - > Launch Services which took care of the problem in 20 seconds. Finally I can right click jpegs again!

Thanks for the tip anyway.

---
WordPress SEO Secrets - foliovision.com/weblog

[ Reply to This | # ]
Try this script instead!
Authored by: ortho on Thu, Jan 1 2009 at 9:58AM PST
I noticed that Ccktail also has the ability to rebuild launch services in Leopard, but I saw this hint posted by "ayemac" on the Apple forums where you create an app in Script Editor that does the whole shebang for you.... just doubleclick and go:

_BEGIN__SCRIPT_
display dialog "The Finder must quit and will relaunch after the Launch Services rebuild is complete. The rebuild may take several minutes, during which time you should refrain from using any other apps." buttons {"Cancel", "Rebuild LS Database"} default button 2 with icon caution
ignoring application responses
tell application "Finder"
delay 2
quit
end tell
end ignoring
delay 5
tell application "System Events" to set running_applications_ to get name of every application process
if running_applications_ contains "Finder" then do shell script "killall Finder"
do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user"
tell application "Finder"
delay 2
activate
end tell
tell me to activate
display dialog "The Launch Services rebuild is now complete." buttons {"OK"} default button 1 with icon note
_END_SCRIPT_

Paste the above into (between the delimiters) "Script Editor" and then do a File->Save As. Specify a "File Format" of "Application" and place it somewhere - e.g. Desktop, and run it.

I tried it and it worked for me. I don't think you even have to restart the finder this way, though i could be mistaken about that. I suppose you could probably delete the dialog boxes and stuff if you wanted.

[ Reply to This | # ]
script link
Authored by: ortho on Thu, Jan 1 2009 at 10:00AM PST
sorry, here's the link to the forum post where i found the script:

http://discussions.apple.com/thread.jspa?messageID=5744911


[ Reply to This | # ]