Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 如何调整用户提示的大小,使其显示框而不是行?_Google Apps Script_Google Sheets_Dialog - Fatal编程技术网

Google apps script 如何调整用户提示的大小,使其显示框而不是行?

Google apps script 如何调整用户提示的大小,使其显示框而不是行?,google-apps-script,google-sheets,dialog,Google Apps Script,Google Sheets,Dialog,我正在使用ui.prompt()获取用户输入,以便我的其余应用程序脚本正常工作。但是,我希望如果用户输入响应的空间更大,那么如果他们必须输入适当的数量(4-5句话),整个文本都是可见的,而不是必须将鼠标移到输入的开始/结束处 我不确定是否有一个函数允许我为输入部分设置自定义大小(高度和宽度,或变量,如文本窗口的“拖动角”) var ui = SpreadsheetApp.getUi(); var bodyresponse = ui.prompt( "The default ema

我正在使用ui.prompt()获取用户输入,以便我的其余应用程序脚本正常工作。但是,我希望如果用户输入响应的空间更大,那么如果他们必须输入适当的数量(4-5句话),整个文本都是可见的,而不是必须将鼠标移到输入的开始/结束处

我不确定是否有一个函数允许我为输入部分设置自定义大小(高度和宽度,或变量,如文本窗口的“拖动角”)

  var ui = SpreadsheetApp.getUi();

  var bodyresponse = ui.prompt(

  "The default email template is: " + 

  "\n\nIf you have any questions regarding your order, please email us directly by replying." +
  "\n\nIf you would like to update your contact information, billing/shipping address, " + 
  "or have an adjustment to make on the Purchase Order attached to this email, " +
  "please reach out to us within 7 days of receiving this Purchase Order." + 
  "\n\nThank you from Area Code 407!" +

  "\n\nWould you like to include an accompanying note? If so, include it below: \n\n\n\n ", 

  ui.ButtonSet.YES_NO);

不幸的是,提示功能不允许您这样做。然而,你可以通过做一个决定来实现你想要的。然后,使用可以将信息传递回服务器端脚本

这不是一个完美的例子,而是需要做什么的总体思路

代码.gs

var htmlOutput = HtmlService
    .createHtmlFromFile('Dialog')
    .setWidth(250)
    .setHeight(300);
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'My Title');

function dialogData(userNote){
   //Do something with userNote...
}
Dialog.html


你好,世界!
默认电子邮件模板为:

如果您对订单有任何疑问,请直接回复电子邮件给我们。如果您想更新您的联系信息、账单/发货地址,或对本电子邮件所附的采购订单进行调整,请 在收到本采购订单后7天内联系我们

谢谢你,区号407

您想随附便条吗?如果是,请包括以下内容:

函数returnData(){ var note=document.getElementById(“userNote”).value 控制台日志(注); google.script.run.onSuccessHandler(closeMe.dialogData();//这将调用main Code.gs服务器端中的脚本。 } 函数closeMe(){ google.script.host.close(); }
您要查找的内容在文档中被称为a。我如何修改当前的code.gs格式,以使用htmlOutput实现这一点?