Actually I'm trying to get the list of ALL open windows as next:
let options = CGWindowListOption(arrayLiteral: .excludeDesktopElements, .optionOnScreenOnly)
let windowsListInfo = CGWindowListCopyWindowInfo(options, CGWindowID(0))
let infoList = windowsListInfo as NSArray? as? [[String: AnyObject]]
but the problem here is that I'm getting also Dock
or Window Server
, SystemUIServer
or widgets on the status bar. How can I improve my code to get avoid from those elements and to get only windows' list, as Xcode
, Finder
, etc.?