1

I want to get the list of apps currently running on macOS, in order of recent usage.

The built-in cmd-tab feature does it.

NSWorkspace.shared.runningApplications returns the set of running apps, but not in the desired order.

As a last resort, I am open to using private api calls as well.

Thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Himanshu P
  • 9,586
  • 6
  • 37
  • 46
  • 1
    Possible duplicate of [NSRunningApplication, return list of recently used applications?](https://stackoverflow.com/questions/2995543/nsrunningapplication-return-list-of-recently-used-applications) – TheNextman Sep 22 '19 at 20:13
  • Please don't [delete a question](https://stackoverflow.com/questions/58050262/macos-programatically-get-all-apps-running-currently) just to repost it again. In the future, just update your original question as needed. – rmaddy Sep 22 '19 at 23:24
  • They've been deprecated for ages, but you might try `GetFrontProcess()` and `GetNextProcess()` to see if they return the apps in the order they're currently stacked. – James Bucanek Sep 23 '19 at 01:19

0 Answers0