10.4: Hide the Spotlight Privacy tab from general view

Jul 05, '06 07:30:00AM

Contributed by: roncross@cox.net

Spotlight is great technology, however, the Privacy tab in Spotlight's System preferences allows someone to walk up to the computer and quickly view what you may consider "private." It's ironic that this may probably be the easy way to view someone's private files and personal information -- just double-click on an entry in the list, and it opens in the Finder.

My solution for keeping this information private is to simply disable the Privacy tab in Spotlight's System Preferences by doing the following (after setting up the items you wish to keep private). I first put a copy of the system's Spotlight.prefPane (from the System -> Library -> PreferencePanes folder) in my user's PreferencePanes directory with the following command:

$ sudo cp -R /System/Library/PreferencePanes/Spotlight.prefPane/ 
~/Library/PreferencePanes/Spotlight.prefPane/
The reason for this is that I only want to disable the Privacy tab in my own home directory; I still want other users with their own accounts to have the ability to use the Privacy tab if they so desire.

Next, I drill down into my copy of the Spotlight.prefPane package, and change the name of the Privacy.nib file to leaveitalong_Privacy.nib with the following command:

$ sudo mv ~/Library/PreferencePanes/Spotlight.prefPane/Contents/
Resources/English.lproj/Privacy.nib ~/Library/PreferencePanes/
Spotlight.prefPane/Contents/Resources/English.lproj/leaveitalong_Privacy.nib
You will have to enter your administrative password and hit Enter after the command. Once you do this, restart System Preferences, and the Privacy tab will no longer be accessible in your account. However, it is still available in the other users' accounts. If you want access to the Privacy tab in Spotlight again (because you want to add or delete items from the Privacy area), simply type the following at the command line.
$ sudo mv ~/Library/PreferencePanes/Spotlight.prefPane/Contents/Resources/
English.lproj/leaveitalong_Privacy.nib ~/Library/PreferencePanes
Spotlight.prefPane/Contents/Resources/English.lproj/Privacy.nib
This gives you the option of locking the Privacy tab from prying eyes while still allowing you to modify the search results in Spotlight's Preference pane. It also allows other users on the computer to continue to access the privacy tab for their own accounts.

When you disable the Privacy tab in Spotlight, it will remain that way even after a restart and repair permissions. From here, it should be straightforward to write a shell script or AppleScript that will enable/disable the Privacy tab for you. I hope this helps.

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060630042500837