Last active
June 7, 2021 13:12
-
-
Save HalCanary/fddb85ab36bdcf9f236398515e86c0e2 to your computer and use it in GitHub Desktop.
MacOS: Vertically Maximize All Open Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env osascript | |
## Vertically maximize all open windows. | |
tell application "Finder" to set BNDS to (bounds of window of desktop) | |
set DESKTOP_HEIGHT to item 4 of BNDS | |
tell application "System Events" to repeat with P in application processes whose background only is false | |
tell application "System Events" to tell P | |
repeat with WIN in windows of P | |
if the value of attribute "AXMinimized" of WIN is false | |
tell WIN | |
set {X, Y} to position | |
set {W, H} to size | |
set position to {X, 0} | |
set size to {W, DESKTOP_HEIGHT} | |
end tell | |
end if | |
end repeat | |
end tell | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment