我想登录一个旨在作为服务运行的应用程序脚本,并且需要用户交互。日志日志(在谷歌脚本编辑器中)确实记录了doGet start条目,但不是处理程序条目......因为点击谷歌编辑器中的执行按钮不会显示UiApp。
I would like to log an apps-script that is meant to be run as a service, and requires user-interaction. The log journal (in google script editor) logs indeed the "doGet start" entry but not the "handler" one... as clicking on the "execute" button in the google editor does not show the UiApp.
我发现有效地看到用户界面的唯一方法是发布脚本并执行它的公共URL ......但我不知道在哪里查找日志。
The only way I found to effectively see the Ui is to publish the script and execute its public url... but then I don't know where to find the logs.
欢迎提供任何提示,谢谢。
Any hint is welcome, thanks.
function doGet() { Logger.log("doGet start"); var app = UiApp.createApplication().setTitle(" "); var handler = app.createServerHandler('selectionHandler'); var docsUI = app.createDocsListDialog().addSelectionHandler(handler).showDocsPicker(); return app; } function selectionHandler(e){ var app = UiApp.getActiveApplication(); Logger.log("handler"); Logger.log(e.parameter); return app; }推荐答案
问题811 要求持久记录器功能。请为它加上星号来添加你的投票。在没有此功能的情况下,您可以将日志写入电子表格单元或您可以看到的Google云端硬盘中的文档。您可以使用Logger.getLog()函数来获取记录器的整个文本
There is an open issue - Issue 811 which asks for a persistent logger function. Please star it to add your vote. In the absence of this feature, you can write the logs to a Spreadsheet cell or a document in your Google Drive which you can see . You can use the Logger.getLog() function to get the entire text of your logger thus far
更多推荐
如何使用用户交互记录应用程序脚本?
发布评论