11 Replies Latest reply: May 1, 2008 6:14 AM by Charly Avital
swestmoreland Level 1 (0 points)
I'm about to connect a SuperDuper clone of my Tiger installation to my fresh, clean install of Leopard. I'm worried that when I open the Applications folder on my Tiger clone, the LaunchServices database will be populated with all of these applications that I never intend to use.

How do I reset/rebuild the LaunchServices database in Leopard, I cannot locate 'lsregister' -- is there a new method, or have things changed in Leopard?

Alternatively/also, is there a way to tell launch services NOT to scan external volumes, or a specific directory?

Thanks everyone for your help!

iPhone 8GB, 2GHz Intel Core Duo Macbook (1st Generation), Mac OS X (10.5)
  • ayeMac Level 1 (0 points)
    Seems to have moved here:

    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fram ework/Support/lsregister
  • Russ Palmeri Level 1 (15 points)
    I see the file, but removing it and restarting Finder has no effect on the duplicate "open with" list. Anyone got any ideas?
  • ayeMac Level 1 (0 points)
    What do you mean by 'removing it'?

    I hope you don't mean the 'lsregister' file?

    The command to run (adapted for Leopard from other posts I've seen) is:

    "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fra mework/Support/lsregister -kill -r -domain local -domain system -domain user"

    without the quotes. I think Finder needs to be restarted to see the effect there.

    Better still, here's an adapted AppleScript I got from a post:

    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 runningapplications to get name of every application process
    if runningapplications contains "Finder" then do shell script "killall Finder"
    do shell script "/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.fr amework/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.
  • Russ Palmeri Level 1 (15 points)
    Here's a way, using the new location of the database and an old tip.
    Open a Terminal window and type in
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister \ -kill -r -domain local -domain system -domain user

    In Leopard, after a few seconds this fixed my duplicate open with list.

    Message was edited by: Russ Palmeri
  • bitman Level 2 (290 points)
    Thank you for the script!
  • mculvers Level 1 (0 points)
    Script worked like a charm, thanks
  • Idlemind Level 1 (10 points)
    Great info....

    I have tried all of the above and still get the same msg...

    Heres the rundown...

    Was running low on space, Ran "DELOCALIZER" to get rid of the extra languages... Ran "WhatSize" and dumped some of the old users I created and iLife stuff that i dont use. (Recovered about 5GB)

    Replaced the stock 100GB drive with a 250 (Used Carbon Copy CLoner)

    Several gigs of music later,

    Bought a 320GB (Internal) and used CCC to clone it...

    Bought Leopard and tried to upgrade... I got the GUID PARTITION message and reformatted, did a fresh install and imported from the 250 drive, all the apps and users.

    Things were fine until i noticed that 2 or 3 apps would crash or give me the not supported on this architecture msg. off hand the ones i can think of were:

    iWatermark - for Photos great product.. support *****..
    ONYX - I just had the old version for Tiger (I got the right one now)
    Need 4 Speed Carbon - Stil doing it.

    I ran the Leopard version of ONYX, the statement at the terminal and The script and still nothin...

    Whats a geek to do??
  • Ergolad Level 1 (0 points)
    This worked like a charm. Once I figured out how to make a script SPOTLIGHT>SCRIP EDITOR & then pasted everything between BEGIN__SCRIPT & END_SCRIPT I was good to go. Seemed to kill some of my OPEN WITH preferred programs, but those are easy enough to rebuild.
  • braintoniq Level 1 (30 points)
    Brilliant, ayeMac. That script worked perfectly. Thanks for posting.
  • ParkerKuivila Level 2 (230 points)
    Use OnyX (Freeware) to fix that.

    Free Image Hosting by FreeImageHosting.net

    Hope this helps!

  • Charly Avital Level 2 (255 points)
    I have carefully copied/pasted the text of your script, in Script Editor 2.2, saved it as an application, as you indicated. But when I click the icon 'Run' in the Editor's tool bar, I get an error message: "AppleScript Error The variable BEGIN__SCRIPTis not defined". I have searched the web, and more precisely, Apple Script's web site for some explanation that could put me on the right track, but nothing. Thanks in advance for your attention.