如何使用按钮或通过编辑触发Google文档脚本? [英] How to trigger google doc script with button or by editting it?

查看:69
本文介绍了如何使用按钮或通过编辑触发Google文档脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试汇总由Google文档上的表单发送的信息(以发出购买请求),以允许或不批准来自Google文档的请求,并在Google Apps脚本功能中检索信息.

I'm trying to summarize info sent by a form (to make purchase requests) on a google doc with a way to approve the request or not from the google doc and retrieve the information in a Google Apps Script function.

问题是在Google文档上触发器onEdit不存在.

The problem is that on Google Document the trigger onEdit doesn't exist.

是否有创建一个的方法?
或者只是添加一个按钮来验证将调用函数的请求?

Is there a way to create one ?
Or simply add a button to validate the request that would call a function ?

谢谢.

推荐答案

添加按钮以在Google文档文档上调用Apps脚本功能的唯一方法是创建对话框或侧边栏.这是通过使用HTML服务来完成的.有关更多详细信息,请参见 https://developers.google.com/apps-script/guides /html/

The only way to add a button that calls an Apps Script function on a Google Documents document is by creating a dialog or sidebar. This is done by using the HTML Service. For further details see https://developers.google.com/apps-script/guides/html/

这篇关于如何使用按钮或通过编辑触发Google文档脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆