Jump to content

List all running applications


Recommended Posts

So far Alfred supports respectively hiding, quitting or force quitting running applications. Maybe it'd be a good idea to integrate these actions in one workflow, namely to list the running apps for activating, hiding, quitting or force quitting, using different modifier keys. 

 

I managed to list running apps using Applescript (`tell application "System Events" to get processes where background only is false`), but it's much slower than the native interface and doesn't support fuzzy match.

Link to comment
Share on other sites

3 hours ago, saor47 said:

but it's much slower than the native interface

 

Try this script. It uses the real APIs, not System Events, so it's much faster.

 

3 hours ago, saor47 said:

fuzzy match

 

Neither does Alfred. If you turn on “Alfred filters results” in your Script Filter, you’ll get basically the same behaviour as Alfred’s built-in quit command.

 

You might also be interested in the workflow I linked above as a starting point. It current only provides an option to quit apps, but it provides a way to specify groups of apps (e.g. "Games", "Not Games") and uses Alfred's File Buffer to save the apps to quit. In theory, you could just add File Actions for the other actions you want to perform (activate, hide, etc.).

Edited by deanishe
Link to comment
Share on other sites

19 hours ago, deanishe said:

 

Try this script. It uses the real APIs, not System Events, so it's much faster.

 

 

Neither does Alfred. If you turn on “Alfred filters results” in your Script Filter, you’ll get basically the same behaviour as Alfred’s built-in quit command.

 

You might also be interested in the workflow I linked above as a starting point. It current only provides an option to quit apps, but it provides a way to specify groups of apps (e.g. "Games", "Not Games") and uses Alfred's File Buffer to save the apps to quit. In theory, you could just add File Actions for the other actions you want to perform (activate, hide, etc.).

Thanks a lot! The API works like a charm :D

 

My solution for fuzzy match was to access Alfred's filecache database to get the match string. 😛

Link to comment
Share on other sites

Just now, saor47 said:

My solution for fuzzy match was to access Alfred's filecache database to get the match string. 😛

 

:D That sounds like an effective if complicated way of going about it…

 

Bear in mind that if you use "Alfred filters results", it only calls your script once, so filtering will be much faster.

Link to comment
Share on other sites

14 hours ago, saor47 said:

That's exactly what I do. I extract the match strings from database for each app and put them in the 'match' field for filtering.

 

Ah, right. That's pretty clever. Dubious, but clever.

Link to comment
Share on other sites

On 11/12/2021 at 10:16 AM, saor47 said:

That's exactly what I do. I extract the match strings from database for each app and put them in the 'match' field for filtering.

Would you be willing to share your workflow? I'd like to see who this works.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...