Take the 2-minute tour ×

I have a need to enumerate the applications that have "windows", "icons", whether if they are minimized to the dock or not. I need basically the list of applications that Command-TAB brings you. How do you do this programmatically?

Everything I tried gave me everything, or just the applications that are NOT minimized. Drives me nuts. Tried CGWindowListCopyWindowInfo, NSArray *runningApps = [workspace launchedApplications], but I can't get to the filtering of the list I need - whatever Cmd-TAB brings you.

share|improve this question
possible duplicate of Getting the list of running applications ordered by last use –  Joshua Nozzi Jul 20 '10 at 23:32
add comment

2 Answers

up vote 1 down vote accepted

This was asked and answered previously here: http://stackoverflow.com/questions/945033/getting-the-list-of-running-applications-ordered-by-last-use

share|improve this answer
But beware that the accepted answer to that question is a private API, which therefore might break on any given software update. –  JWWalker Jul 21 '10 at 3:45
Thanks. Now I am using this to receive a list of running applications: NSArray *launchedApps = [[NSWorkspace sharedWorkspace] launchedApplications]; Now I want to enumerate the windows open (or minimized) under each application. I'm particularly interested in the Window Name (e.g. the text on the caption) and the window ID. The application name needs to be the "key" by which I do this. I'd appreciate it if anyone could point me in the right direction. –  RM1970 Jul 21 '10 at 15:42
I believe the only way to do this is with the Accessibility Framework. –  Joshua Nozzi Jul 21 '10 at 18:11
add comment

You might try -[NSWorkspace runningApplications] which is available since 10.6. It gives the list of NSRunningApplication, whose properties can be inspected to some extent. I'm afraid it might not give you what you want, though.

share|improve this answer
add comment

Your Answer


