SpreadsheetApp.getUi() operation not supported?
14:15 10 Feb 2014

Trying to add a confirmation dialog when a user clicks a menu item, I am following this Google page almost to the letter: https://developers.google.com/apps-script/guides/dialogs#alert_dialogs

However, I am getting a "This operation is not supported" error message. In the Execution Transcript, I see this:

[14-02-10 12:21:54:551 EST] Starting execution
[14-02-10 12:21:55:550 EST] Execution failed: This operation is not supported (line 28, file "Code") [0.226 seconds total runtime]

Line 28 in "Code" is the second line of the function below:

function sendMergedMail() {
  var ui = SpreadsheetApp.getUi();
  var result = ui.alert(
     'Please confirm',
     'Are you sure you want to continue?',
      ui.ButtonSet.YES_NO);
  if (result != ui.Button.YES) {
    return
  }

  var doc = SpreadsheetApp.getActiveSpreadsheet();
  doc.toast("Current sheet: "+doc.getName());
};
google-sheets google-apps-script