• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is it possible to use Apple's Notification Center to display alerts using JavaScript?

Contributor ,
Feb 18, 2015 Feb 18, 2015

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"

TOPICS
Scripting

Views

261

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 13, 2021 Jan 13, 2021

Copy link to clipboard

Copied

LATEST

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);
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines