alert 또는 prompt에 추가할 수 있는 사전 정의된 현지화된 하나 이상의 대화상자 버튼 세트를 나타내는 enum입니다. 사용자가 클릭한 버튼을 확인하려면 Button를 사용하세요.
enum을 호출하려면 상위 클래스, 이름, 속성을 호출합니다. 예를 들면
Base.ButtonSet.OK입니다.
// Display a dialog box with a message and "Yes" and "No" buttons.constui=DocumentApp.getUi();constresponse=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.');}
속성
속성
유형
설명
OK
Enum
닫을 수만 있는 정보 메시지를 나타내는 '확인' 버튼 1개
OK_CANCEL
Enum
사용자가 작업을 진행하거나 중지할 수 있는 '확인' 버튼과 '취소' 버튼
YES_NO
Enum
사용자가 예/아니요 질문에 답할 수 있는 '예' 버튼과 '아니요' 버튼
YES_NO_CANCEL
Enum
'예' 버튼, '아니요' 버튼, '취소' 버튼: 사용자가 예/아니요 질문에 답변하거나 작업을 중지할 수 있습니다.
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003e\u003ccode\u003eButtonSet\u003c/code\u003e is an enum used to create predefined, localized button sets for dialog boxes in Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt provides options like \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eOK_CANCEL\u003c/code\u003e, \u003ccode\u003eYES_NO\u003c/code\u003e, and \u003ccode\u003eYES_NO_CANCEL\u003c/code\u003e for different dialog scenarios.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the user's button click by comparing the response to \u003ccode\u003eui.Button\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThese button sets are used with \u003ccode\u003ealert()\u003c/code\u003e and \u003ccode\u003eprompt()\u003c/code\u003e methods of the \u003ccode\u003eUi\u003c/code\u003e class.\u003c/p\u003e\n"]]],[],null,[]]