-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b2b278
commit dbbcdeb
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: > | ||
Minimize all windows on Mac OS | ||
date: 2024-06-17 | ||
description: AppleScript to quickly minimize every window on my Mac OS. This is not hiding the windows but minimizing them to the dock. | ||
slug: mac-minimize-all-windows | ||
titleImage: ./minimize-all-blogsplash.png | ||
titleImageAlt: '' | ||
titleImageSource: { text: null, href: null } | ||
tags: ['macOS'] | ||
ghCommentsIssueId: null | ||
published: true | ||
--- | ||
|
||
I have the issue that I tend to keep a lot of windows open on my Mac. This issue persists until my next reboot but in some cases I just get overwhelmed by all the mess. Unfortunately there is no built-in feature in Mac OS to minimize all windows at once. But there is a simple way to do it with an AppleScript. | ||
|
||
## Create the AppleScript | ||
|
||
You can use this AppleScript to minimize all windows. You might get asked for accessibility permissions the first time you run it. | ||
|
||
```applescript | ||
tell application "System Events" | ||
set theProcesses to (every process whose visible is true and name is not "Finder") | ||
repeat with proc in theProcesses | ||
tell proc | ||
set theWindows to every window | ||
repeat with win in theWindows | ||
set value of attribute "AXMinimized" of win to true | ||
end repeat | ||
end tell | ||
end repeat | ||
end tell | ||
tell application "Finder" to set collapsed of windows to true | ||
``` | ||
|
||
As I am an [Alfred](https://www.alfredapp.com/) user I created a small worflow to execute this via Spotlight. You can download it [here](/misc/Minimize-all.alfredworkflow). Also check out my [Alfred VS Code extension](/blog/alfred-vscode-workflow). | ||
|
||
## Other solutions | ||
|
||
I stumbled upon [this superuser thread](https://superuser.com/questions/36504/how-to-minimize-all-windows-in-macos) asking for the same thing. The answers point out the exposé and the `Command+Option+H+M` key combo. The later one unfortunately doesnt work for me as it only hides the windows, without them appearing in the dock as minimized windows. |
Binary file added
BIN
+113 KB
content/blogposts/mac-minimize-all-windows/minimize-all-blogsplash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.