• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Dev Tips / Mac Maximize Window with Alfred

Mac Maximize Window with Alfred

Last updated on June 22, 2025 by Sal Ferrarello

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).

Update: This solution has a bug where it does not properly handle multiple displays. See Issue #1 Does not handle multiple displays on the GitHub repo.
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.

Alfred window selecting the 'Maximize Current Window' workflow.

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

Alfred Workflow Editor AppleScript to Maximize Current Window

Permissions

In order for this script to work, Alfred needs Accessibility access to your computer.

  1. Click the Apple Icon
  2. Select System Settings... from the dropdown
  3. Select Privacy & Security
  4. Select Accessibility
  5. Add Alfred (if necessary) and toggle on

macOS System Settings > Privacy & Security > Accessibility > Alfred enabled

Download

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

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP and JavaScript developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a principal engineer.
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: Alfred

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2026 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in