Creating a shortcut for Zooming (maximizing) windows that actually works on every app?

As of MacOS 10.6.6, there's no keyboard shortcut that I know of for zooming (maximizing) the window.
There's ⌘M to minimize, though.
I made a custom shortcut, defined it on the keyboard preferences pane, but as it identifies the menu command by name ("zoom"), it clashes with other commands in some applications, for example this one I'm using right now, Firefox. It briefly highlights the view menu, giving me a hint that the command matched by "zoom" is inside that menu, but in this case, zoom is just a submenu that has the options zoom in and zoom out, but it's obviously not related to zooming the window.
Is there any other way of setting this shortcut to work in such cases?


The following Applescript will trigger the zoom button (that´s button 2) in the frontmost application´s window. You could make this a service and define a global shortcut for it or use an application like quicksilver to call it.

tell application "System Events"
set frontApplication to (get name of every process whose frontmost is true) as string
tell process frontApplication
    click button 2 of window 1
end tell
end tell 

I have assigned this script to ⌘M with FastScripts:

try
    tell application "Finder" to bounds of window of desktop
    tell application (path to frontmost application as text)
        set bounds of window 1 to result
    end tell
on error
    try
        tell application "System Events" to tell (process 1 where it is frontmost)
            click (button 1 of window 1 where subrole is "AXZoomButton")
        end tell
    end try
end try

It doesn't work if you have multiple displays though.

Applications that support maximizing windows to fill the screen:

  • BetterSnapTool
  • BetterTouchTool
  • Breeze
  • Divvy
  • Flexiglass
  • iKey
  • Keyboard Maestro
  • Moom
  • NuKit
  • OptimalLayout
  • QuicKeys
  • RightZoom
  • SecondBar
  • ShiftIt
  • SizeUp
  • SizeWell
  • Slate
  • WrongZoom