Created
September 5, 2025 17:46
-
-
Save whoo/2750250e06ebe4631c852867f5282c6f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| echo 'tell application "System Events" | |
| set visibleProcesses to (every process whose visible is true) | |
| set totalOpenWindows to 0 | |
| repeat with aProcess in visibleProcesses | |
| try | |
| tell aProcess | |
| set windowCount to count of (windows whose value of attribute "AXMinimized" is false) | |
| set totalOpenWindows to totalOpenWindows + windowCount | |
| end tell | |
| on error | |
| -- Some applications may not respond to window queries, handle errors gracefully | |
| end try | |
| end repeat | |
| display dialog "Total visible open windows: " & totalOpenWindows | |
| end tell | |
| ' | osascript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment