Google表格:可安装的触发器似乎禁用了简单的触发器脚本 [英] Google Sheets: installable trigger seems to disable simple trigger script

查看:80
本文介绍了Google表格:可安装的触发器似乎禁用了简单的触发器脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Google表格,该表格具有一个功能,如果左侧的列已更新,则该功能会在该列中输入时间戳.它由简单的onedit触发器触发,并且仅处理工作表中的一小部分单元格.对许多人来说,它已经工作了好几个月了.

I have a Google sheet with a function that enters a timestamp in a column if the column to its left is updated. It is triggered by the simple onedit trigger, and it only processes for a small set of cells in the sheet. It has worked fine for months with many people.

然后,我添加了一个脚本来在同一文档的单独选项卡上进行一些数据清除.我使用可安装的触发器,以便可以安排每周执行一次清理.

Then I added a script to do some data cleanup on a separate tab of the same doc. I use an installable trigger, so that I can schedule the cleanup to run once each week.

不幸的是,尽管计划的可安装触发器清除例程现在可以正常运行,但是原始的onedit简单触发器时间戳例程却不能.更准确地说,时间戳例程对我(脚本的作者)有效,但不适用于其他任何人.

Unfortunately, while the scheduled installable trigger cleanup routine now works, the original onedit simple trigger timestamp routine does not. To be more precise, the timestamp routine works for me, the author of the script, but it does not work for anyone else.

有什么办法解决这个问题吗?

Any idea how to address this?

谢谢!

推荐答案

时间戳例程对我(脚本的作者)有效,但不适用于其他任何人.

the timestamp routine works for me, the author of the script, but it does not work for anyone else.

问题可以在Stackdriver日志中找到.转到脚本编辑器>查看>执行>清除所有过滤器.检查失败的日志.最可能的原因是您限制了对这些人的访问.如果键盘上的用户"不允许手动执行某项操作,他也无法通过脚本执行该操作.另一个可能的原因是匿名编辑无法显示弹出窗口/对话框.如果将此类代码添加到函数中,则函数将失败.

Issue can be found in Stackdriver logs. Go to Script Editor>View> Executions>Clear all filters. Check the failed logs. Most possible reason is You restricted access to those people. If the "user at the keyboard" is not permitted to do something manually, He cannot do that through scripts either. Another possible reason is Anonymous edits cannot show popups/dialogs; If you added such code to your function, Your function will fail.

  • 提供必要的权限或

  • Provide the necessary permission or

创建一个可安装的onEdit触发器,以便该功能将在您的授权下运行.在这种情况下,如果编辑者能够访问您的编辑器,则他们可能能够像您一样执行脚本.保护所有不受保护范围的印张可能会有所帮助,但不能提供完全的安全性.减少授权的访问范围也可能有帮助

Create a installable onEdit trigger, so that the function will run under your authority. In this case, if editors are able to access your editor, they may be able to execute scripts as you. Protecting all sheets with unprotected ranges may help this, but does not provide complete security. Reducing authorised access scope might also help

另一种方法是通过创建服务帐户并使用 oauth库来访问工作表. "https://github.com/gsuitedevs/apps-script-oauth2/blob/master/samples/GoogleServiceAccount.gs" rel ="nofollow noreferrer">在此处采样和

Another way to do this is by creating a service account and use oauth library to access the sheet.Sample here and here.

这篇关于Google表格:可安装的触发器似乎禁用了简单的触发器脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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