I have just made this to test if another application is currently running.
But i am pretty sure this is not sandbox friendly, and will get a rejection.
Can anyone think of a way to test if another app is currently running that will be sandbox friendly.
I think accessing system events is a no no, right..?
Code: Select all
// Check if Another application is running
function isApplicationRunning pTheApplication -- where pTheApplication is the name of the application
do "tell application" && quote & "System Events" & quote & cr \
& "count (every process whose name is" && quote & pTheApplication & quote & ")" & cr \
& "end tell" as applescript
return the result -- greater than 0 if running, 0 if not
end isApplicationRunning