tell application "System Events"
set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell
if isRunning then
tell application id "com.Growl.GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to ¬
{"Plex Media Server Restarted"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
-- in the 'Applications' tab of the growl prefpane.
set the enabledNotificationsList to ¬
{"Plex Media Server Restarted"}
-- Register our script with growl.
-- You can optionally (as here) set a default icon
-- for this script's notifications.
register as application ¬
"Plex Media Server Script" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Plex Media Server"
-- Send a Notification...
notify with name ¬
"Plex Media Server Restarted" title ¬
"Plex Media Server Restarted" description ¬
"" application name "Plex Media Server Script"
end tell
end if