0

I'm new with Google Apps Script Programming. I have piece mealed this code from other answers on S.O. Am I doing something wrong? I call the msg(s) routine from Google sheet, and nothing pops up. Any help is appreciated. Thx.

function msg(s) { //*************************************************************
    var app = UiApp.getActiveApplication();
    var pnl = app.createHorizontalPanel().setStyleAttribute('zIndex', '1') ;
    var text = app.createTextArea().setName("text");
    var handler = app.createServerHandler("count").addCallbackElement(text);
    pnl.add(text); 
    pnl.add(app.createButton("Count", handler));
    pnl.add(app.createLabel("0 characters").setId("label"));
    return pnl;
}
function count(eventInfo) {
    var app = UiApp.createApplication();
    app.getElementById("label").setText(eventInfo.parameter.text.length+" characters");
    return app;
}
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
aka_norm
  • 1
  • 4

1 Answers1

0

You need to take steps to display your user interface. Read Displaying a User Interface from a Spreadsheet.

var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
spreadsheet.show(app);
Mogsdad
  • 44,709
  • 21
  • 151
  • 275