I the past, in order to determine whether the Growl helper is running on macOS, I've used
tell application "System Events"
set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell
But recently, both this and an alternative thats been suggested
tell application "System Events" to set isRunning to exists (processes where name is "com.Growl.GrowlHelperApp")
just run forever. This seems to happen (only) when it (or more precisely the app "Hardware Growler" is not running), but is still clearly not the desired outcome.
How do I determine whether Growl is running using AppleScript?
While I was not able to identify a process name that hints at GrowlHelper running in the background (Growl 2.13, Mac App Store version), I found an alternative solution.
In fact Growl 2.13 may not even need to use GrowlHelperApp itself to launch on user login.
Check whether Growl is set to launch on login
In Terminal type
defaults read ~/Library/Containers/com.Growl.GrowlHelperApp/Data/Library/Preferences/com.Growl.GrowlHelperApp.plist ShouldStartGrowlAtLogin
This will output a value of 1 (true) or 0 (false). This file is modified every time you toggle the switch in Growl's preferences.
来源:https://stackoverflow.com/questions/43588494/how-do-i-determine-whether-growl-is-running-using-applescript