// Display a dialog box with a message and "Yes" and "No" buttons.
const ui = DocumentApp.getUi();
const 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.');
}
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-12-02 (世界標準時間)。"],[[["`ButtonSet` is an enum used to create predefined, localized button sets for dialog boxes in Apps Script."],["It provides options like `OK`, `OK_CANCEL`, `YES_NO`, and `YES_NO_CANCEL` for different dialog scenarios."],["You can determine the user's button click by comparing the response to `ui.Button` values."],["These button sets are used with `alert()` and `prompt()` methods of the `Ui` class."]]],[]]