1

I can get a count of Firefox windows in the current Space, including any minimized windows (from any Space - what odd semantics) using something like this:

tell application "System Events"
    count of windows of process "Firefox"
end tell

... and I can get a count of any minimized windows (from any application/space) with this:

tell application "System Events" to tell process "Dock"
    count (UI elements of list 1 where role description is "minimized window dock item")
end tell

I cannot, however, figure out how to assemble a count of:

  1. non-minimized windows,
  2. for a specific application,
  3. on the current Space.
0

1 Answer 1

1

I figured this out shortly after posting, because of course I did (thanks, Script Debugger — what a cool find):

tell application "System Events"
    count (windows of process "Firefox" where value of attribute "AXMinimized" is true)
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .