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

10.7: Remove the Developer category from Spotlight results System 10.7
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.]
    •    
  • Currently 3.00 / 5
  You rated: 1 / 5 (7 votes cast)
 
[11,181 views]  

10.7: Remove the Developer category from Spotlight results | 15 comments | Create New Account
Click here to return to the '10.7: Remove the Developer category from Spotlight results' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Remove the Developer category from Spotlight results
Authored by: nathanator11 on Aug 26, '11 07:55:06AM

Well, this may work, but there's a much easier way to do this.

Go to System Preferences-> Spotlight -> Privacy. Click the [+] button and add /Developer. This prevents Spotlight from searching that folder.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: lowbatteries on Aug 26, '11 01:25:50PM

This isn't about searching the /Developer folder, it's about searching source code files. I have tons of html, css, js, php, and other files in my home directory, and those are all listed under Developer in the spotlight results.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: nathanator11 on Aug 26, '11 04:12:10PM

Hmm, this got rid of source code from Spotlight results on my machine...
Good to know that it doesn't always work, though.

I wonder, do you have any special apps that would have added source code like that?



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: lowbatteries on Aug 28, '11 03:30:48PM

The files are there because I'm a developer and I put them there. The point of this hint was to remove a whole category of file types from Spotlight search, no matter where that type of file is on your hard drive or how they got there.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: cycomachead on Aug 26, '11 09:24:53AM

I DO see the option in System Prefs…. hmm.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: azeotropo on Aug 26, '11 11:31:31AM
Well there's an easier way to edit .plist archives without downloading the ~3 GB Xcode. TextWrangler can edit this archives and it's a free 29 MB application.

[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: nahdan on Aug 26, '11 02:51:48PM

i created an account here just to comment on this post:
thank you for this tip. this just rocked my world.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: slferris on Aug 27, '11 07:34:24AM

I couldn't get this to work using Property List Editor. The system preference panel for Spotlight shows a new category, but the name field is blank. Shouldn't it show the name as "SOURCE"? In any case, doing a Spotlight search still turns up html docs.



[ Reply to This | # ]
File not found?
Authored by: Crazor on Aug 27, '11 02:55:08PM

I was wondering why there was no com.apple.spotlight.plist file on my system. This being a fresh install, I hadn't changed any spotlight preferences. Opening Spotlight preferences, unchecking and rechecking any of the options created the file.



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: Anonymous on Aug 27, '11 02:59:54PM
Well, the quality of these hints lately are not up to the standard it used to be!

First of all. If you install Xcode you will have the Developer option in the normal Spotlight preference window and you can disable it the normal way.

Secondly. As someone else wrote here. TextWrangler and BBEdit are perfectly capable of taking care of binary plists so there is no need for converting.

And for those who prefer to use terminal you can add the missing dictionary and disable the Developer category with one command. This is a hint! :-)

defaults write com.apple.spotlight orderedItems -array-add "<dict><key>enabled</key><false/><key>name</key><string>SOURCE</string></dict>"


[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: gopes on Aug 27, '11 06:52:15PM

Is this different than just unchecking the category in "Search Results" in the Spotlight prefPane? I did that, and I still get, for example, Dashcode (which I wouldn't if I added /Developer to the Privacy tab, as the first poster suggested), but I no longer get a particular .js file that showed up, in the Developer category, before unticking the box. I'm on Lion...



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: lowbatteries on Aug 28, '11 04:29:25PM

Are you suggesting that you have a "Developer" category in your spotlight preferences? The point of this hint is that there is no Developer category to un-check. I don't have one on any of my three Lion machines ...



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: gopes on Aug 29, '11 05:31:56AM

I do have one. I just checked on my friend's MBAir, who also has Xcode installed, and he doesn't have it. I should have checked his before I posted, because I guess this is a new entry in 10.7.2. Something to look forward to! ;)

Edit:
P.S. Since my friend has Xcode installed, and has 10.7.1, I don't think the previous poster is correct about Xcode installation adding the category...

Edited on Aug 29, '11 05:36:46AM by gopes



[ Reply to This | # ]
For the curious: applying this method to other things may not work
Authored by: magnamous on Aug 29, '11 11:21:58PM

Sooo, after trying this hint a few different ways (seems to work, but the "Developer" name doesn't show up in Sys Prefs—it's blank), I decided to get fancy, run the strings binary mentioned elsewhere in the comments, and extract the relevant item for the dictionary definitions (I'd like to have them display much higher in the results list, you see). I found something called MENU_DICTIONARY_DEFINITION, the only string with a seemingly-appropriate name, plugged it into the plist file in the same manner as in the hint, and did the ol' log out & log in. I rapidly discovered that, not only did it not show up in the listings in Sys Prefs, but I also had no functioning Spotlight menu at all.

Deleting the preferences file and re-logging out fixed it, but I'm sad that I can't have dictionary definitions (and the web searches!) near the top of the results list.

Also, why do .htm files show up under the Developer section of the search results? Why not under the Webpages section? And why do Safari web archives show up in the Documents section? Annoying…



[ Reply to This | # ]
10.7: Remove the Developer category from Spotlight results
Authored by: madfax7 on Jan 18, '12 05:50:09PM

Just to clarify for those googling this, if you install Xcode you WILL get a fully functional option in the Spotlight preference pane (in 10.7.2 with Xcode 4). You can always delete the /Developer folder if you don't need the developer tools. Of course, since there's some type of official support for the option there must be a way to enable this without installing Xcode—or at least without installing all of it. I surmise it's either a setting in a defaults file or a modification to the search.bundle CoreService itself, although I wasn't able to figure out how to enable it without Xcode—not that I spent that long trying, since I need Xcode anyways. I'd be curious if anyone finds a non-Xcode solution!

Also of note, the aforementioned preference plist hack works however it will only save the setting as long as you do not open the Spotlight preferences.



[ Reply to This | # ]