Enum Button

버튼

alert 또는 PromptResponse.getSelectedButton()에서 반환된 미리 결정되고 현지화된 대화상자 버튼을 나타내는 열거형으로, 사용자가 대화상자에서 클릭한 버튼을 나타냅니다. 이 값은 설정할 수 없습니다. alert 또는 prompt에 버튼을 추가하려면 대신 ButtonSet를 사용하세요.

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

속성

속성유형설명
CLOSEEnum모든 대화상자의 제목 표시줄에 표시되는 표준 닫기 버튼. 이 버튼은 대화상자에 명시적으로 추가되지 않으며 삭제할 수 없습니다.
OKEnum작업이 계속되어야 함을 나타내는 '확인' 버튼.
CANCELEnum작업을 계속해서는 안 된다는 것을 나타내는 "취소' 버튼.
YESEnum질문에 긍정적으로 응답한 '예' 버튼입니다.
NOEnum'아니요' 버튼: 질문에 대한 부정적인 응답을 나타냅니다.