For a while I used the following way of displaying a notification with an AppleScript dragged into the project :
on run {notif, titler}
display notification notif with title titler
end run
Simple enough, worked every time. Well, that was until El Crapitan. Today in 10.11.5 it sometimes displays, sometimes not. No rule I could find to work around.
So I thought maybe using AppleScript was too simple, and I should employ NSUserNotifications instead. So I went to the faithful MBS Complete collection, and used :
[code] dim u as new NSUserNotificationMBS
u.Title = “Hello World”
u.subtitle = “from Real Studio.”
u.informativeText = “Our first Notification from Real Studio.”
dim d as new date
d.Second = d.Second + 1
u.deliveryDate = d
dim c as new NSUserNotificationCenterMBS
c.scheduleNotification u[/code]
You know what ? Same punishment : sometimes it works, sometimes it won’t !
I verified that I did not have anything preventing notifications display in Preferences like Do Not Disturb.
This is plain annoying.
Will I be forced to mock up notifications with a window like I do on the other side now ? Grrr.
Have you tried deliver notification instead of schedule? Also I never set a date or time when a notification should up. However by default the application has to be in the background for the notification to show, this can be overridden by using attaching a delegate or I think you can also switch the notification type to alert (in App Wrapper, click the “action” icon next to High Resolution).