The other question asks the same but using AppleScript. Apple introduced JavaScript as a new language for Automation in OS X 10.10.
Asked
Active
Viewed 1,875 times
1 Answers
2
From Terminal,
osascript -l JavaScript -e "app=Application.currentApplication(); app.includeStandardAdditions = true; app.displayNotification('Hello, world', {withTitle: 'Title'})"
From Script Editor,
app = Application.currentApplication()
app.includeStandardAdditions = true
app.displayNotification('Hello, world', {withTitle: 'Title'})
subtitle
andsoundName
. – Chris Kobrzak Oct 03 '16 at 10:31