如何使用用户交互记录应用程序脚本?

编程入门 行业动态 更新时间:2024-10-23 23:32:17
本文介绍了如何使用用户交互记录应用程序脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想登录一个旨在作为服务运行的应用程序脚本,并且需要用户交互。日志日志(在谷歌脚本编辑器中)确实记录了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

更多推荐

如何使用用户交互记录应用程序脚本?

本文发布于:2023-11-27 15:59:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638658.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   应用程序   脚本   用户

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!