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

Add Hide and Hide Others to dock menus Desktop
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.app
% cd Contents/Resources/English.lproj
% sudo cp DockMenus.plist DockMenus.bak
% sudo pico DockMenus.plist
The 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:
<key>process</key>
Scroll down (with the arrow keys) about 25 lines, which should place you in this section of the file:
<dict>
<key>command</key>
<integer>1005</integer>
<key>name</key>
<string>Show In Finder</string>
</dict>
Immediately below the closing </dict> tag, insert the following lines:
<dict>
<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>
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.

I have tested this on 10.2, and it works exactly as described...
    •    
  • Currently 3.33 / 5
  You rated: 4 / 5 (3 votes cast)
 
[16,980 views]  

Add Hide and Hide Others to dock menus | 25 comments | Create New Account
Click here to return to the 'Add Hide and Hide Others to dock menus' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Or even easier
Authored by: davidjschloss on Sep 17, '02 02:07:39AM

Or you could just option-click an application's name in the dock. None of that pico hacking. ;)



[ Reply to This | # ]
.plist files
Authored by: Andrea on Sep 17, '02 03:59:56AM

This hint is very interesting, but it rises an old question; where can I find more information about .plist files and how they work?? It seems we can do a lot of personalization knowing how to hack these files, but I've not found any information about them.



[ Reply to This | # ]
cmd-opt-click, transparant dock
Authored by: mclbruce on Sep 17, '02 04:47:41AM

Option-clicking on a dock icon hides the frontmost app. Command-Option-clicking hides all other apps. No hacking necessary.

Transparent Dock 2.0.2 allows you to add a "hide" menu to the dock menu of all applications. Not the same as a "hide others" menu, but very useful.



[ Reply to This | # ]
hide others using Transparant Dock
Authored by: mclbruce on Sep 17, '02 05:03:00PM

I added the Hide option for all applications in the dock menu with Transparant Dock. Holding down option before click-hold-ing on a dock item changes Hide to Hide Others.

Transparant Dock is free, it's cool, and it's here:
http://www.freerangemac.com/



[ Reply to This | # ]
TransparentDock 2 ...
Authored by: sjk on Sep 19, '02 10:42:36PM

... is $8 shareware.



[ Reply to This | # ]
Restarting the dock seems unnecessary
Authored by: fm on Sep 17, '02 04:52:52AM

I did the editing and clicked on some icons: I didn't need to restart Dock.app to se the menu items, they just appeared.
Btw, non english user should better edit files in [their language].lproj directory.



[ Reply to This | # ]
Hide From Dock
Authored by: Worboren on Sep 17, '02 06:27:58AM

A very simple, straightforward and small utility Hide From Dock enables Hide functionality in the Dock menu. No hacking, just double click and it's there :) Perhaps they'll update it to also enable Hide Others some day. Find it here: http://www.versiontracker.com/moreinfo.fcgi?id=15917&db=mac



[ Reply to This | # ]
What about launchbar?
Authored by: dogboy on Sep 17, '02 07:44:59AM

If you use launchbar (a very good utility which lets you find any app or file or email address or anything superfast), there is the option in prefs to use shift-command-h to hide all other apps than the one frontmost. You can even hide classic apps. No hacking, no menus, just a keyboard shortcut. And isn't command-h a system wide shortcut to hide the current app anyway?



[ Reply to This | # ]
What about launchbar?
Authored by: nichrome on Sep 17, '02 08:01:25AM

Uh, yeah, but Shift-Command-H is the keyboard shortcut for Home (as of Jaguar). Launchbar's use of a reserved system shortcut is questionable.



[ Reply to This | # ]
Or option-click where-ever...
Authored by: Hedderik on Sep 17, '02 10:07:27AM

...the option click doesn't need to be in the dock. An option-click everywhere except on the application that you want to hide does the trick.



[ Reply to This | # ]
Hide ALL ?
Authored by: tarkin on Sep 17, '02 11:02:46AM

I really would like a HIDE ALL menu option or keycombo.
That way I can get at my Desktop without having to open finder windows.

That way I can place Aliases of Applications on the Desktop AND actually use them.
Much like the "Show Desktop" buttons in KDE and Windows.

Any Idea how ?

And: yes I know you could put the desktop folder in to the dock and rightclick to get to the Desktop contents. But I'd rather have the real Desktop instead of the folder ;-)



[ Reply to This | # ]
Hide ALL ?
Authored by: taikahn on Sep 17, '02 11:39:39AM

Hold Option-Commmand and click the finder icon in the dock. Voila.



[ Reply to This | # ]
Hide ALL ?
Authored by: rdeeg on Sep 17, '02 12:08:38PM

That opens a Finder window. Tarkin was trying to avoid that.



[ Reply to This | # ]
Hide ALL ?
Authored by: bluehz on Sep 17, '02 12:34:00PM

I have found the option+cmd+click to be much less reliable in 10.2 than in previous OS versions. Most times its switches to the Finder but leaves a few windows in the background - usually Mozilla or Mailsmith. I have to use a QuicKey to then Hide All - pain in the ass - especially since it used to work beautifully!



[ Reply to This | # ]
Hide ALL ?
Authored by: tarkin on Sep 18, '02 06:44:03AM

Well, it does the job to a certain extent.
It still opens a finder window if there aren't any. Or if there are open windows, they don;t get hidden ;-(

But thanx for the tip !



[ Reply to This | # ]
Hide ALL ?
Authored by: hombre on Sep 17, '02 01:43:57PM

I use Keyboard Maestro and map
F12 to "switch to Finder, hide others"
F13 to "hide others"
F14 to "hide current application"

The F12 shortcut does not open a new window and amounts to "show desktop" on my machine only because I don't use the Finder and so never have Finder windows open. HotApp works just as well for those shortcuts. QuicKeys is odious.



[ Reply to This | # ]
Hide ALL ?
Authored by: mahakali on Sep 26, '02 02:51:05AM

you can use Youpi Key. It's a free yet powerful utility.



[ Reply to This | # ]
Great hack
Authored by: eagle on Sep 17, '02 01:42:47PM

I have wanted this for months, and have even sent the suggestion to Apple to no avail.

I don't know what the other commenters are complaining about. Sure, you can option-click and command-option-click an icon, but what if I don't want to change the currently focused app -- what if I just want to hide some other app? With this, I can do it.

I did this on 10.1.5 and it works, except I don't see "Hide Others" -- the only changes to my dock menu are "Hide" and the separator.



[ Reply to This | # ]
re: Great hack
Authored by: huzzam on Sep 17, '02 02:57:23PM
I did this on 10.1.5 and it works, except I don't see "Hide Others" -- the only changes to my dock menu are "Hide" and the separator.

If you hold down "option," "Hide" will change to "Hide Others." If you want both available all the time, remove the lines that say

dynamic
0

&

dynamic
1

peace
peter

[ Reply to This | # ]

re: Great hack
Authored by: huzzam on Sep 17, '02 03:01:33PM

(Trying again in plain text, since html comments seem a bit broken, see above)

> I did this on 10.1.5 and it works, except I don't see "Hide Others" -- the only changes to my dock menu are "Hide" and the separator.

If you hold down "option," "Hide" will change to "Hide Others." If you want both available all the time, remove the lines that say

<key>dynamic</key>
<integer>0</integer>

&amp;

<key>dynamic</key>
<integer>1</integer>

peace
peter



[ Reply to This | # ]
Show _both_ Hide and Hide Others
Authored by: aqsalter on Sep 17, '02 11:27:27PM
If you don't want to have to hold down Option to get the Hide Others command, just remove the <key>dynamic</key>
<integer>0</integer>
sections of the example code above, then you get both thus: Show In Finder Hide Hide Others The new code:
<dict>
<key>command</key>
<integer>1006</integer>
<key>name</key>
<string>Hide</string>
</dict>

<dict>
<key>command</key>
<integer>1007</integer>
<key>name</key>
<string>Hide Others</string>
</dict>

<dict>
<key>command</key>
<integer>2000</integer>
<key>separator</key>
<true/>
</dict>



[ Reply to This | # ]
Show Desktop
Authored by: grrr223 on Sep 29, '02 08:28:22PM

This hint is great, except that it doesn\'t apply to the Finder, only when you click on an application or \"process\" in the dock. So I looked a little bit more at the DockMenu.plist file and it looks like it lists all the commands that appear in the dock for the Finder, files, folders, processes, the trash, etc. Since it handles the Finder as separate from other applications, I just added the same lines there too. Just hit control - W and search for \"finder-running\". Right before the lines:

<dict>
<key>command</key>
<integer>1003</integer>
<key>dynamic</key>
<integer>0</integer>
<key>name</key>
<string>Quit</string>
</dict>

I entered:

<dict>
<key>command</key>
<integer>1006</integer>
<key>name</key>
<string>Hide</string>
</dict>
<dict>
<key>command</key>
<integer>1007</integer>
<key>name</key>
<string>Show Desktop</string>
</dict>

As you can see, I changed "Hide Others" to "Show Desktop" :)
There is a separator there already, but I can't get a separator to appear between the window names and my new Hide and Show Desktop commands, any suggestions?



[ Reply to This | # ]
Show Desktop
Authored by: Magnum on Oct 06, '02 07:08:40PM

Just add two seperators:
<dict>
<key>command</key>
<integer>2000</integer>
<key>separator</key>
<true/>
</dict>
<dict>
<key>command</key>
<integer>2000</integer>
<key>separator</key>
<true/>
</dict>



[ Reply to This | # ]
Beautiful!
Authored by: jspivack on Oct 05, '02 09:47:30AM

Hey, this is great. I had written/found an AppleScript to do this, but this method is *so* much faster...



[ Reply to This | # ]
Color
Authored by: robotbill on Jan 04, '03 02:37:08AM

Does anyone know how to change to color of the menu items?



[ Reply to This | # ]