小编Luc*_*ano的帖子

\n无法在谷歌应用程序脚本Browser.msgBox中工作

我正在尝试以下操作将消息符添加到消息框但它无法正常工作.

function showMsgBox(){
  var msg = 'name: \n \n \n Doc URL';
  Browser.msgBox("Selected Doc template:", msg, Browser.Buttons.OK);
}
Run Code Online (Sandbox Code Playgroud)

单引号或双引号无关紧要.

我也试过,Browser.msgBox(msg);但它都是一样的.

我究竟做错了什么?

谢谢.

google-apps-script

17
推荐指数
1
解决办法
1万
查看次数

谷歌应用程序脚本TextBox值未传递给e.parameter.TextBoxName

在下面的代码中,我定义了一个名称和id的TextBox.按钮处理程序工作正常,但我无法获得在TextBox上输入的值.msgBox显示但e.parameter.matchValue显示为undefined.

在应用程序的其他部分,我有相同的逻辑,但使用ListBox,它工作正常.

我究竟做错了什么?

function chooseColumnValueToMatch() {
  var app = UiApp.createApplication().setHeight(150).setWidth(250);
  var ss = SpreadsheetApp.getActiveSpreadsheet();

  var columnName = ScriptProperties.getProperty("columnNameToMatch");

  var h1Line = app.createHTML("<h2>Value to match "+columnName+":</h2>");
  var textPara = app.createHTML("<p>Type the VALUE that the <b>"+columnName+"</b> column must match EXACTLY to send the message.</p>");
  var selectionHandler = app.createServerHandler('chooseColumnValueToMatchSelectionHandler');
  var valueInputBox = app.createTextBox()
      .setTitle("Match value for "+columnName)
      .setName("matchValue")
      .setId("matchValue");
  var submitBtn = app.createButton("Submit", selectionHandler);

  app.add(h1Line)
    .add(textPara)
    .add(valueInputBox)
    .add(submitBtn);
  ss.show(app);
}
function chooseColumnValueToMatchSelectionHandler(e){
  var app = UiApp.getActiveApplication();
  var columnName = …
Run Code Online (Sandbox Code Playgroud)

google-apps-script

2
推荐指数
1
解决办法
2460
查看次数

标签 统计

google-apps-script ×2