Simon icon Simon
Flexible server monitoring

Is Process Running Service

The Is App Running Service is limited to apps/processes which are running in the user context (or have a UI?) and I needed something which would monitor a root level process.

After messing around with ps, I came up with following AppleScript which is a drop-in replacement for Is App Running:

try
do shell script "ps -axo comm | grep {Application}"
return 0
on error
return 1
end try

However in testing I am getting a very small number of false positives - this is returning 0 when the process is not running about 5% of the time. Running the ps from the command line I can't reproduce this...

Does anyone have any improvements to the command, or a better way to test if a root level process is running.

David Sinclair's picture

Re: Is Process Running Service

Maybe putting the app name in single quotes (around the variable) might help?

Someone else might bbe able to offer some more helpful advice, though.