NotificationCenterExample
on userNotificationCenter_shouldPresentNotification_(notificationcenter, notification)
return 1
end userNotificationCenter_shouldPresentNotification_
on notification(aTitle, aSubtitle, aMessage)
set userNotification to current application's NSUserNotification's alloc()'s init()
set userNotification's title to aTitle
set userNotification's subtitle to aSubtitle
set userNotification's informativeText to aMessage
current application's NSUserNotificationCenter's defaultUserNotificationCenter's deliverNotification_(userNotification)
current application's NSUserNotificationCenter's defaultUserNotificationCenter's setDelegate_(me)
userNotification's release()
end notification
notification("THIS IS TEST", "notification test", "This is notification test from cocoa applescript applet.")
~~~~
Cocoaブリッジしているので通常のAppleScriptではなくCocoa-Applescript AppletかCocoa-Applescript Applicationで動くコードです。