Last October, this hint discussed a means of adding a "Hide" dock menu to certain Cocoa applications (a non-trivial hint involving Project Builder and some detailed work). But today, while glancing back through some older hints (to see what still works in 10.2), I noticed that Reeko submitted a very very cool hack in the comments which does the same thing for all applications, and it's much easier to implement ... so I felt it was worthy of a hint of its own, instead of living in the comments of the existing hint.
Once you add these menus, you'll be able to do an option-control click and hide all other apps while switching applications (or just control-click to hide the current application while switching). Very useful!
Open the Terminal and type the following commands:
% cd /System/Library/CoreServices/Dock.appThe first two lines (broken up for a narrower display) switch to the directory where the file that contains the dock's contextual menus lives, and the second line backs up that file (after entering your administrative password). The third line opens the file, with root priviliages, in the pico text editor (use your favorite, of course). Once pico is open, type Control-W to enter the search mode, and type process and hit return. This should lead you to a line that looks like this:
% cd Contents/Resources/English.lproj
% sudo cp DockMenus.plist DockMenus.bak
% sudo pico DockMenus.plist
<key>process</key>Scroll down (with the arrow keys) about 25 lines, which should place you in this section of the file:
<dict>Immediately below the closing </dict> tag, insert the following lines:
<key>command</key>
<integer>1005</integer>
<key>name</key>
<string>Show In Finder</string>
</dict>
<dict>Save the file then use the terminal or Process Viewer to quit the dock, and you should have your new menus available! If not, replace the modified file with your backed up original and try again.
<key>command</key>
<integer>1006</integer>
<key>dynamic</key>
<integer>0</integer>
<key>name</key>
<string>Hide</string>
</dict>
<dict>
<key>command</key>
<integer>1007</integer>
<key>dynamic</key>
<integer>1</integer>
<key>name</key>
<string>Hide Others</string>
</dict>
<dict>
<key>command</key>
<integer>2000</integer>
<key>separator</key>
<true/>
</dict>
I have tested this on 10.2, and it works exactly as described...

