Home
Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Get A List Of Processes Running On A Mac With JavaScript

This script produces a list of the foreground and background processes running on a mac

osascript
#!/usr/bin/env osascript -l JavaScript 

const processList = Application("System Events").applicationProcesses;
const appCount = processList.length;

for (let appIndex = 0; appIndex < appCount; appIndex ++) {
  console.log(processList[appIndex].name());
}
results start

- This script is a JavaScript For Automation OSA script

- It takes several seconds to run on my machine

- You can make it executable and run it as a file or call it from the command line with :

[TODO: Code shorthand span ]

[] Link the post that shows how to do just the foreground apps