Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[14,770 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 whomever posted them. This site is not responsible for what they say.
Or even easier
Authored by: davidjschloss on Tue, Sep 17 2002 at 2:07AM PDT
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 Tue, Sep 17 2002 at 3:59AM PDT
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 Tue, Sep 17 2002 at 4:47AM PDT
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 Tue, Sep 17 2002 at 5:03PM PDT
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 Thu, Sep 19 2002 at 10:42PM PDT
... is $8 shareware.


[ Reply to This | # ]
Restarting the dock seems unnecessary
Authored by: fm on Tue, Sep 17 2002 at 4:52AM PDT
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 Tue, Sep 17 2002 at 6:27AM PDT
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 Tue, Sep 17 2002 at 7:44AM PDT
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 Tue, Sep 17 2002 at 8:01AM PDT
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 Tue, Sep 17 2002 at 10:07AM PDT
...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 Tue, Sep 17 2002 at 11:02AM PDT
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 Tue, Sep 17 2002 at 11:39AM PDT
Hold Option-Commmand and click the finder icon in the dock. Voila.

[ Reply to This | # ]
Hide ALL ?
Authored by: rdeeg on Tue, Sep 17 2002 at 12:08PM PDT
That opens a Finder window. Tarkin was trying to avoid that.

[ Reply to This | # ]
Hide ALL ?
Authored by: bluehz on Tue, Sep 17 2002 at 12:34PM PDT
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 Wed, Sep 18 2002 at 6:44AM PDT
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 Tue, Sep 17 2002 at 1:43PM PDT
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 Thu, Sep 26 2002 at 2:51AM PDT
you can use Youpi Key. It's a free yet powerful utility.

[ Reply to This | # ]
Great hack
Authored by: eagle on Tue, Sep 17 2002 at 1:42PM PDT
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 Tue, Sep 17 2002 at 2:57PM PDT
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 Tue, Sep 17 2002 at 3:01PM PDT
(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 Tue, Sep 17 2002 at 11:27PM PDT
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 Sun, Sep 29 2002 at 8:28PM PDT
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 Sun, Oct 6 2002 at 7:08PM PDT
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 Sat, Oct 5 2002 at 9:47AM PDT
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 Sat, Jan 4 2003 at 2:37AM PST
Does anyone know how to change to color of the menu items?

[ Reply to This | # ]