Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSRunningApplication, return list of recently used applications?

I'm trying to get a list of the most recently used applications. NSWorkspace returns a list of active applications and I can sort them on a few options using NSRunningApplication. see list below:

- launchDate
- finishedLaunching
- processIdentifier

I don't want the launch date but the most recent 'active' date (like the way cmd-tab sorts). Does anyone know the solution for this?

like image 913
Martijn Avatar asked Sep 11 '25 06:09

Martijn


1 Answers

There is no documented way of doing this that I'm aware of, but I wrote exactly what you are asking for using private APIs: http://gist.github.com/163918

Also, see Getting the list of running applications ordered by last use for solutions that do not use private APIs.

like image 190
0xced Avatar answered Sep 12 '25 22:09

0xced