Created
November 12, 2025 22:36
-
-
Save yeiichi/570f117e3e48a851e088436eeec9c799 to your computer and use it in GitHub Desktop.
Lists currently running GUI apps on macOS (like Command–L App Switcher)
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
| #!/bin/zsh | |
| # display-running-apps.sh | |
| # Lists currently running GUI apps on macOS (like Command–L App Switcher) | |
| osascript <<'EOF' | tr ',' '\n' | sed 's/^ *//; s/ *$//' | |
| tell application "System Events" | |
| set app_list to (name of every process whose background only is false) | |
| end tell | |
| return app_list | |
| EOF | |
| # Get all running applications using AppleScript | |
| # osascript <<'EOF' | |
| # tell application "System Events" | |
| # set app_list to (name of every process whose background only is false) | |
| # end tell | |
| # return app_list | |
| # EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment