class Browser method .buttons()

Browser is the Apps Script service.

.buttons() is the method name you will see after a dot in your code.

What it does

Returns button constants used with msgBox and inputBox.

Why it's used

  • Pass YES_NO or OK_CANCEL into msgBox and inputBox.
  • Build confirm-or-cancel flows with standard buttons.

Common errors

  • Forgetting parentheses on buttons. Write Browser.buttons(), not Browser.buttons or buttons by itself.
  • Skipping dots between chained calls. Each step needs a dot, like Browser.buttons().
  • Adding spaces where they do not belong. Write Browser.buttons(), not Browser .buttons(), Browser.buttons (), or Browser . buttons().
  • Wrong capitalization. Use Browser and buttons, not browser or buttons.

Explore

Related methods

  • .msgBox()

    Shows a message box with OK or other buttons.

  • .inputBox()

    Shows a dialog that asks the user to type a response.

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about Browser.buttons().

Browse the blog