Copy link to clipboard
Copied
Hi all,
Is it possible to use Apple's Notification Center to display alerts using JavaScript?
Now I am using
alert("This is my Alert");
However, this displays a static alert that requires action from me.
For me it would be easier to make advantage of the Notification Center.
In Applescript it is something like this:
display notification "My Allert" with title "Alert Title"
Copy link to clipboard
Copied
with the system command:
macNotification ("JavaScript", "Nur ein Test!", "Tink");
function macNotification (title, note, sound) {
var appleScript = "'display notification \"" + note +
"\" with title \"" + title + "\" sound name \"" + sound + "\"'";
app.system("osascript -e " + appleScript);
}