Google apps script 如何使用新功能扩展UiApp?

Google apps script 如何使用新功能扩展UiApp?,google-apps-script,Google Apps Script,我想在谷歌应用程序脚本中使用包装功能扩展(原型)UiApp,但在运行下面这样的简单示例时,我遇到了TypeError。。。 我做错了什么 Object.prototype.addLabel = function(text) { this.createLabel(text); return this; } function testingxUiApp() { var doc = SpreadsheetApp.getActiveSpreadsheet(); var app =

我想在谷歌应用程序脚本中使用包装功能扩展(原型)UiApp,但在运行下面这样的简单示例时,我遇到了TypeError。。。 我做错了什么

Object.prototype.addLabel = function(text) {   
  this.createLabel(text);
  return this;
}

function testingxUiApp() {
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var app = UiApp.createApplication().setTitle('playing around UiApp').setHeight("250");
  var panel = app.createFlowPanel().setId('panel');
  app.add(panel);
  panel.add(app.addLabel("adding label for testing"));
  doc.show(app);
}

谢谢

无法扩展UiApp、文档、电子表格和其他高阶类。谷歌阻止了它。如果要执行对象的
var isObject=UiApp.createApplication()实例行,则
isObject
为false,尽管UiApp.createApplication()的
类型为false表达式返回
对象

谢谢,即使不是好消息,也很高兴知道,像这样的情况当然很高兴知道,谢谢,这是我的目标,我很固执,所以会很痛苦^^好问题!{一般问题,因此不仅仅是UiApp,而是GAS中的任何Google类}我在中详细介绍和回答,包括这里的答案以及我遇到的所有其他答案;所以,如果这对你有帮助的话,我建议在这里看到我的答案。我投票结束这个问题,因为UiApp类已被弃用。参考文献