场景

tutorial

// 
// Get the current application and set it up 
// for scripting. 
// 
var app = Application.currentApplication();
app.includeStandardAdditions = true;

// 
// Send a message to the user. 
// 
app.displayAlert("This is a message");

// 
// Let the user pick from a list. 
// 
var lang = app.chooseFromList(['JavaScript', 'AppleScript', 'JXA'], { withPrompt: 'What is your favorite language?' });
app.displayNotification(lang, { withTitle: 'Language Chooser', subtitle: 'Your Choice is...' });