Jump to content
aik099

Get process list

Recommended Posts

Hi,

 

How to get currently running processes (including/excluding background ones) within the workflow?

 

I've noticed, when I type "hide" keyword inside Alfred it shows running processes instantly. I have no idea how it does that.

 

I've tried using this command (from "Running" workflow), but it takes 2 seconds to get me the list:

 

osascript -e 'tell application "System Events" to get the file of every process whose background only is false'

 

Share this post


Link to post
2 hours ago, aik099 said:

I have no idea how it does that.

 

This, probably:

https://developer.apple.com/documentation/appkit/nsworkspace/1534059-runningapplications

 

AppleScript is pretty much always slow because there’s a lot of overhead in talking to applications.

 

A native Cocoa app, like Alfred, can just ask the framework it’s running in.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...