Skip to content

Instantly share code, notes, and snippets.

@NeoCat
Created December 6, 2011 16:22
Show Gist options
  • Save NeoCat/1438794 to your computer and use it in GitHub Desktop.
Save NeoCat/1438794 to your computer and use it in GitHub Desktop.
Count windows of the specified application in MacOS X
#!/bin/sh
osascript -e 'tell application "System Events"
try
count every window of process "'"$1"'"
on error
0
end try
end tell' 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment