10.7: Remove the Developer category from Spotlight results
Aug 26, '11 07:30:00AM
Contributed by: Raws
Lion added a 'Developer' category to Spotlight search results which isn't listed in Spotlight's System Preferences pane. It seems to list source code files (including HTML help files from various packages) from all over the system.
All those files can clutter Spotlight results. If, for example, you use Spotlight only to launch applications, disabling every category except for 'Applications' will still yield a few dozen 'Developer' entries.
Luckily, we can disable the 'Developer' category by editing Spotlight's preferences file.
This hint requires Xcode, which is available as a free (but large) download from the Mac App Store. As property list files have been binary since Snow Leopard, you'll need Xcode or another property list editor to open them.
- Find and open ~/Library/Preferences/com.apple.spotlight.plist. In Lion, you'll need to use Go to Folder… to access your Library folder. You can also type:
open ~/Library/Preferences/com.apple.spotlight.plist
in a Terminal shell.
- Inside the property list, find the orderedItems key. This is an array of dictionaries describing which Spotlight categories to display in the results of a search. If this key does not exist, try disabling a Spotlight category in Spotlight's System Preferences pane and re-opening com.apple.spotlight.plist.
- Add a new dictionary to the orderedItems array. Add two keys to the dictionary:
- enabled: a boolean; set this to NO
- name: a string; set this to SOURCE
- Save and close com.apple.spotlight.plist.
- Log out, then log back in again to see changes in Spotlight results.
Credit goes to Keith Bauer for finding the right name value (using /usr/bin/strings /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search).
[crarko adds: I tried this, and it does indeed seem to eliminate source code files from the search. If you are a developer, you probably want those to be searchable via Spotlight, so this hint may not be for you. If you create the dictionary and want to see the Developer results again, change the boolean 'enabled' to YES.
Editing these in Xcode can be a bit painful if you haven't done it before. I suggest making a backup of com.apple.spotlight.plist before making any changes.]
Comments (15)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20110805192212447