【发布时间】:2020-03-23 08:31:01
【问题描述】:
我正在尝试通过脚本代码发布 Web 应用程序。我读了this post,但我无法让它工作,也许情况略有不同。我有一个复制电子表格的脚本:在脚本中,我想将电子表格的新副本发布为网络应用程序,如果可能,检索其公共 url(任何人都应该能够访问它)。
这是我的代码:
// Make a copy of the spreadsheet
var repliesFile = responseTemplate.makeCopy('risposte', newFolder);
var repliesId = SpreadsheetApp.openById(repliesFile.getId());
// pubblish the new copy as a web app
Drive.Revisions.update({published: true, publishedOutsideDomain: true, publishAuto: true}, repliesId, 1);
// of course, this doesn't work.. I need a way to get the web app public url of the new copy
var webAppUrl = ScriptApp.getService().getUrl();
我收到 404 错误。我究竟做错了什么?脚本中启用了 Drive Api v.2。感谢您能给我的任何帮助!
【问题讨论】:
标签: google-apps-script google-sheets google-drive-api