pxldot/templates — pull request #7 by gonefish (2013-11-30 03:48:47+00:00)
Title: Add Notification Center support for OS X 10.9.

Hi, I add Notification Center support for OS X 10.9, but i don't install Growl latest version, so i commit "notify with name theType title theTitle application name applicationName description theDescription callback URL theURL".

What do you think ?

to notify(theTitle, theDescription, theType, theURL)
if system version of (system info) ≥ "10.9" then
display notification with title theTitle subtitle theDescription
else
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 "GrowlHelperApp.app"
«event register» given «class appl»:applicationName, «class anot»:allNotifications, «class dnot»:defaultNotifications, «class iapp»:iconApplication
if length of theURL is 0 then
«event notifygr» given «class name»:theType, «class titl»:theTitle, «class appl»:applicationName, «class desc»:theDescription
else
--notify with name theType title theTitle application name applicationName description theDescription callback URL theURL
end if
end tell
end if
end if
end notify