Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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 
share|improve this answer

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:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.