How can I get a CGWindowID
from the title of it?
I thought I can get list of titles by this code
let options = CGWindowListOption(arrayLiteral: CGWindowListOption.excludeDesktopElements, CGWindowListOption.optionOnScreenOnly)
let windowListInfo = CGWindowListCopyWindowInfo(options, CGWindowID(0))
let infoList = windowListInfo as NSArray? as? [[String: AnyObject]]
https://stackoverflow.com/a/31367468/1536527
But it seems there is no info for title of the windows.
How can I get CGWindowID
or any info to specify a window by title?