One of the things that frustrates me about Apple Macs (macOS) is clicking the green sizing button in the upper-left hand corner makes a window full screen. I almost never want to go full screen. What I typically want is to maximize the window (fill up the entire area while leaving the toolbar visible). This can be done by holding down Option while you click the green button (but I find I mess that up often enough that I wanted another solution).
I’ve started using the app Rectangle in the meantime as an alternative solution.
I’m a big user of Alfred (a Mac application for shortcuts, snippets, and workflows), so I created a workflow to maximize the current window.
While I could have bound this to a hot key combination, I’m typically not a big hot key combination person and instead created a keyword to trigger it.

Here is the AppleScript that does the work.
on run argv
tell application "Finder"
set desktopSize to bounds of window of desktop
end tell
set screenWidth to item 3 of desktopSize
set screenHeight to item 4 of desktopSize
tell application "System Events"
set frontAppName to name of first application process whose frontmost is true
tell application process (name of first application process whose frontmost is true)
try
set position of front window to {0, 0}
set size of front window to {screenWidth, screenHeight}
return "Maximized \"" & frontAppName & "\""
on error
return "This application's window cannot be resized by AppleScript."
end try
end tell
end tell
end run

Permissions
In order for this script to work, Alfred needs Accessibility access to your computer.
- Click the Apple Icon
- Select
System Settings...from the dropdown - Select
Privacy & Security - Select
Accessibility - Add
Alfred(if necessary) and toggle on

Download
This workflow is available online at https://github.com/salcode/maximize-window-alfredworkflow
Leave a Reply