How to check in AppleScript if an app is running, without launching it – via osascript utility
I suspect the reason you are getting this is because each time you call the script from the command line with osascript the script is being compiled. The act of compiling on a tell application will afaik make the app launch. Calling the script from the command line with osascript from a pre-compiled file i.e … Read more