How to get name of processes for system processes?

If I do a “tell application ‘System Events’ to get name of processes,” it only lists the names of your user account processes. Is there any AppleScript way to get the full list, including system or root processes? I’ve got a feeling that it’s going to require a shell script, but I don’t know the Unix.

Model: MacBook Pro (5,2)
AppleScript: 2.1.2
Browser: Firefox 28.0
Operating System: Mac OS X (10.6)

Hi Schmye,

do shell script “/bin/ps aux”

Stefano - Ame

Thanks, Stefano!

So I take it that there’s not a native AppleScript command to list system processes?

I get the -a and -x arguments in your ps command, but why is the -u necessary?

I’m always using ps -Ac -o comm. -A is the same as -a and -x. The -c will cut the full path into only the command name and with -o I define the format that I only want to print the command names.

There are however some drawbacks using ps because all commands that are needed inside bash but also needed to run the shell are listed in the list of processes including ps itself. So when using awk, grep or sed to reformat the output is also listed in the list of processes.

paragraphs 2 thru -1 of (do shell script "ps -Ac -o comm")

Thanks, DJ Bazzie Wazzie!