📜  枚举 ButtonSet 应用程序脚本 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:36.211000             🧑  作者: Mango

代码示例1
// Display a dialog box with a message and "Yes" and "No" buttons.
var ui = DocumentApp.getUi();
var response = ui.alert('Are you sure you want to continue?', ui.ButtonSet.YES_NO);

// Process the user's response.
if (response == ui.Button.YES) {
  Logger.log('The user clicked "Yes."');
} else {
  Logger.log('The user clicked "No" or the dialog\'s close button.');
}