saor47 Posted November 11, 2021 Share Posted November 11, 2021 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 More sharing options...
deanishe Posted November 11, 2021 Share Posted November 11, 2021 (edited) 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 November 11, 2021 by deanishe Link to comment Share on other sites More sharing options...
saor47 Posted November 12, 2021 Author Share Posted November 12, 2021 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 My solution for fuzzy match was to access Alfred's filecache database to get the match string. 😛 Link to comment Share on other sites More sharing options...
deanishe Posted November 12, 2021 Share Posted November 12, 2021 Just now, saor47 said: My solution for fuzzy match was to access Alfred's filecache database to get the match string. 😛 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 More sharing options...
saor47 Posted November 12, 2021 Author Share Posted November 12, 2021 50 minutes ago, deanishe said: Alfred filters results 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. deanishe 1 Link to comment Share on other sites More sharing options...
deanishe Posted November 13, 2021 Share Posted November 13, 2021 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 More sharing options...
evanfuchs Posted November 14, 2021 Share Posted November 14, 2021 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 More sharing options...
saor47 Posted November 25, 2021 Author Share Posted November 25, 2021 On 11/14/2021 at 3:55 PM, evanfuchs said: Would you be willing to share your workflow? I'd like to see who this works. Here's the JXA script for script filter. evanfuchs and deanishe 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now