Tuesday, April 9, 2013

OSX Cmd: Getting Rid of "Open With" duplicates


You right-click icon in the Finder, choose "Open With", and a submenu pops up with an absurd number of duplicate entries.

The duplicate entries in the "Open With" submenu are caused by some corruption of the Launch Services database. The lsregister command, which is buried many layers under the /System/Library folder, will rebuild the database if you invoke it with the right options.

Here’s a on how to fix it (and you can add to your .bashrc):

# Quick way to rebuild the Launch Services database and get rid
# of duplicates in the Open With submenu.
alias fixopenwith='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user'

Now you can get rid of the duplicates from the Terminal by running:

fixopenwith

You may need to follow that up with a:

killall Finder



OSX Cmd: Customize Mission Control To Show Only Windows From Current Desktop Space

To get Mission Control to only show you open windows from the current Desktop Space, type or paste the following into your Terminal:

defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool FALSE

Then, restart the Dock process, which also controls the Mission Control process:

killall Dock

Now you’ll only see windows from the currently active Desktop Space when you activate Mission Control.



NOTE: Return it back:

defaults write com.apple.dock wvous-show-windows-in-other-spaces -bool TRUE

killall Dock