Home:ALL Converter>How can I list all open windows on Mac from a Python script?

How can I list all open windows on Mac from a Python script?

Ask Time:2018-09-28T06:23:51         Author:Al Sweigart

Json Formatter

I'd like to be able to grab a list of all windows that are open on macOS/OS X from a Python script. This would be the Mac equivalent on win32's EnumWindows API call.

Ideally, I'd like to be able to use this to get a list of the title/caption text of every open window along with position/size information.

Is there an OS or Cocoa API call that will return this info?

Author:Al Sweigart,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52545917/how-can-i-list-all-open-windows-on-mac-from-a-python-script
yy