Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Try this script instead!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Try this script instead!
Authored by: ortho on Jan 01, '09 09:58:50AM

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:

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
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
end tell
tell me to activate
display dialog "The Launch Services rebuild is now complete." buttons {"OK"} default button 1 with icon note

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 Jan 01, '09 10:00:34AM
sorry, here's the link to the forum post where i found the script:

[ Reply to This | # ]