How to List All Windows of One App That Are Open in All Desktops

If you’re willing to use JXA, the Core Graphics framework might be able to enumerate the full list of windows.

It contains some low-level C APIs, one of which in particular seems pertinent:

CGWindowListCopyWindowInfo().

It takes two arguments, which you can probably just pass 0 for each:

ObjC.import('CoreGraphics');
ObjC.deepUnwrap($.CGWindowListCopyWindowInfo(0, 0));
2 Likes