So I have an app that analyses the running apps, my code so far
func running() -> [NSRunningApplication]{
let base = NSWorkspace()
let apps = base.runningApplications
return apps
}
for app in running() {
print(app.localizedName)
print("isActive: \(app.isActive) | isHidden: \(app.isHidden) | ")
}
I can determine lots of properties . However I want to filter apps that have UI kind of like the ones in the Force Quit Applications menu:
So any tips on how to filter these apps?
Filter for activationPolicy == .regular
let apps = base.runningApplications.filter {$0.activationPolicy == .regular}
Source: NSApplicationActivationPolicy