How to get list of all applications currently running and visible in Dock for Mac OS X programming?
问题 I need to know which applications are running and have an active window. Something similar must be what's in the 'command + tab' hotkey switcher. When I run some code like this: NSWorkspace * ws = [NSWorkspace sharedWorkspace]; NSArray * apps = [ws runningApplications]; NSLog (@"%@", apps); I get this in my log: "<NSRunningApplication: 0x6080001052b0 (com.apple.loginwindow - 66)>", "<NSRunningApplication: 0x608000105340 (com.apple.systemuiserver - 285)>", "<NSRunningApplication: