Created
January 20, 2021 14:28
-
-
Save alanhg/524ad85896219036034bfe81f76df209 to your computer and use it in GitHub Desktop.
hide app app
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
tell application "System Events" to set all_apps to the name of every process whose visible is true | |
repeat with a in all_apps | |
tell application a to try | |
repeat with w in (get every window) | |
set miniaturized of w to true | |
end repeat | |
on error | |
activate | |
tell application "System Events" to repeat (count windows of process a) times | |
keystroke "m" using command down | |
delay 0.1 | |
end repeat | |
end try | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment