Skip to content

Instantly share code, notes, and snippets.

@yeiichi
Created November 12, 2025 22:36
Show Gist options
  • Select an option

  • Save yeiichi/570f117e3e48a851e088436eeec9c799 to your computer and use it in GitHub Desktop.

Select an option

Save yeiichi/570f117e3e48a851e088436eeec9c799 to your computer and use it in GitHub Desktop.
Lists currently running GUI apps on macOS (like Command–L App Switcher)
#!/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