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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/161.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 - Fatal编程技术网

Google apps script 在谷歌工作表上,我想创建一个按钮,当点击时作为链接

Google apps script 在谷歌工作表上,我想创建一个按钮,当点击时作为链接,google-apps-script,google-sheets,Google Apps Script,Google Sheets,按钮内的链接是指向链接的Google表单的链接。 我知道如何绘制按钮,但不知道如何编写脚本并将其分配给按钮/图像 我需要按钮执行的链接是: 非常感谢所有帮助请遵循以下步骤: 1) 在脚本编辑器(工具>脚本编辑器)上添加此函数(我已经添加了表单URL): 函数openForm(){ var html=“window.open('https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmO

按钮内的链接是指向链接的Google表单的链接。 我知道如何绘制按钮,但不知道如何编写脚本并将其分配给按钮/图像

我需要按钮执行的链接是:

非常感谢所有帮助

请遵循以下步骤:

1) 在脚本编辑器(工具>脚本编辑器)上添加此函数(我已经添加了表单URL):

函数openForm(){ var html=“window.open('https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform');"; var ui=HtmlService.createHtmlOutput(html) SpreadsheetApp.getUi().showModelessDialog(ui,“演示”); }
  • 保存脚本(Ctrl+S)
  • 回到工作表,单击按钮>单击三个点>分配脚本…>输入openForm
  • 瞧!当您单击按钮时,表单将在新选项卡中打开。请注意,您可能需要允许弹出窗口。

    可能重复的
    function openForm(){
    
      var html = "<script> window.open('https://docs.google.com/forms/d/e/1FAIpQLSdupUHV2uO6q69BHXvPzE1DgJu32HYQ31zPdyZ5uflmOftXRw/viewform');</script>";
      var ui = HtmlService.createHtmlOutput(html)
      SpreadsheetApp.getUi().showModelessDialog(ui,"demo");
    
    }