Keyboard Shortcut to Maximize Current Window / Application in OSX

80

24

I am using OSX 10.9.1. Is there a keyboard shortcut to simulate the maximize and minimize functions that you normally find on the top left hand corner of the screen? I read some of the other questions asked on SuperUser about this, but they are all quite old. Any updates to the latest versions of Mac that make this possible now without 3rd party add-ons?

Lloyd Banks

Posted 2014-02-18T20:34:27.997

Reputation: 1 085

Question was closed 2014-02-20T23:15:53.427

Even if this is a "dupe", the answer, below, using the Keyboard Sys Pref that applies specifically to window maximization is dope (and not at the other location). Yes. Dope. – ruffin – 2014-08-31T20:38:30.187

3( control + command + F ) goes to full screen – eneski – 2018-02-08T21:44:45.343

3do you mean OSX in the title and content? your tags and content don't match – None – 2014-02-18T21:00:32.367

Answers

90

Assign a shortcut for the Zoom menu item (or whatever it's called in your locale) from System Preferences:

If you want the shortcut to always maximize a window to fill a screen, you can use for example Spectacle:

Or add a line like this to ~/.slate with Slate:

bind m:cmd;shift move screenOriginX;screenOriginY screenSizeX;screenSizeY

I have used FastScripts to assign a shortcut to this script:

try
    tell application "Finder" to set b to bounds of window of desktop
    try
        tell application (path to frontmost application as text)
            set bounds of window 1 to {item 1 of b, 22, item 3 of b, item 4 of b}
        end tell
    on error
        tell application "System Events" to tell window 1 of (process 1 where it is frontmost)
            try
                set position to {0, 22}
                set size to {item 3 of b, (item 4 of b) - 22}
            on error
                click (button 1 of window 1 where subrole is "AXZoomButton")
            end try
        end tell
    end try
end try

When you tell System Events to change the position and size through the accessibility API, there is a noticeable delay between when the position and the size are changed. Telling the application to change the bounds of a window is faster but it doesn't work with all applications. Other applications like Slate and Moom always use the accessiblity API.

Lri

Posted 2014-02-18T20:34:27.997

Reputation: 34 501

10Zoom is not minimize/maximize/resize. – orbfish – 2014-10-06T18:15:15.090

4+10 for Spectacle. Lifesaver! – Barrett Kuethen – 2015-11-19T00:49:46.550

Take a peek here for detailed formal presentation of this 'Zoom' idea, in addition to a whole bunch more! http://osxdaily.com/2013/03/22/5-simple-window-management-keyboard-shortcuts-to-improve-workflow-in-mac-os-x/

– J-Dizzle – 2016-01-11T14:51:16.190

1It's not called 'Zoom' or 'Maximize' for me. How do I find the 'locale' of which you speak - so I can check what it's called? – Zeth – 2017-05-25T16:19:38.517

Was thrown off by the word 'zoom', but setting 'Zoom' to cmd+m, and setting minimize to cmd+shft+m as per this answer allowed me to maximize with the former and minimize with the latter.

– shoe – 2019-07-06T05:26:41.867

25

Sorry I made a mistake about minimizing window. It's ready from Apple. So, I amended.

Answer:

  • Command-M :Minimize the active window to the Dock
  • Command-Option-M :Minimize all windows of the active application to the Dock
  • (Setup is required) :Maximize the active window

To maximize the active window(application), you must assign the operation to shortcut key as follows;

  1. Go to System Preferences>Keyboard>Shortcuts>App Shortcut, then click "+" to add shortcut key.
  2. Choose "All Application" which means this change will affect all application, put the text "Maximize" in "Menu Title" textbox and press "Command+Shift+M" in "Shortcut Key" textbox.
  3. Restart Window(Application) which you would like to affect by the shortcut key.(No reboot requred)
  4. You will find new menu item in the menu bar also.

Recommendation basis:

I recommend you to use below shortcut key instead of using default minimizing shortcut key.

To Minimize the active window(application):

Command+H :Hide active window(application)

It's possible to minimize the active window in above shortcut key but actually it's hidden the active window(application). And, if you use this shortcut key, you can switch hidden window by shortcut key which is "Command + Tab" quickly. If you minimize the active window by Command+M, you can not switch application by command + Tab quickly and you have to click the application from Dock.)

You can refer related information in below.

http://support.apple.com/kb/HT1343, http://support.apple.com/kb/PH13911

Juza

Posted 2014-02-18T20:34:27.997

Reputation: 827

4Command+H is awesome, save the day :) – brownylin – 2014-11-24T02:44:29.290

Filezilla for mac has some issues. Maximize, zoom does not work - seems they have not exposed the Window menus. Messed up after connecting to a projector. – tgkprog – 2014-11-29T08:18:32.370

Doesn't work for me. I'm on OS X El Capitan (10.11.3). – jbyrd – 2016-02-24T16:12:45.220

Woau, that Command+H really is awesome. Thanks a lot for the tip! – Alex – 2016-03-10T09:24:28.700

"Maximize" in "Menu Title" doesn't do the work, "Zoom" does – Bastet – 2016-07-28T06:19:27.187

8Command+Control+F fullscreens an app in 10.12.5, which is a good enough maximise for me – wreckgar23 – 2017-07-08T14:18:49.223