Enum ButtonSet

コレクションでコンテンツを整理 必要に応じて、コンテンツの保存と分類を行います。
ButtonSet

alert または prompt に追加できる 1 つ以上のダイアログ ボタンの事前定義されたローカライズされたセットを表す列挙型。ユーザーがクリックしたボタンを特定するには、Button を使用します。

// 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.');
}

Properties

プロパティ種類説明
OKEnum1 つの [OK] ボタン。閉じることができません。
OK_CANCELEnum「OK」ボタンと「キャンセル」ボタン。ユーザーは操作を続行または停止できます。
YES_NOEnum「はい」ボタンと「いいえ」ボタン。ユーザーは「はい」または「いいえ」で答えることができます。
YES_NO_CANCELEnum「はい」ボタン、「いいえ」ボタン、「キャンセル」ボタン。ユーザーは「はい/いいえ」と答えるか、操作を停止します。