如何复制Google工作表并保留其项目触发器和脚本? [英] How to copy a Google sheet and keep it's project triggers and scripts?

本文介绍了如何复制Google工作表并保留其项目触发器和脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个用作主模板的Google表格.也就是说,我为每个请求都制作了该模板的副本.我想向我的主模板添加一个Google App脚本(在工作表完成后,该onEdit POST到我的服务器上)将被复制并针对该模板的每个副本运行.

I currently have a Google Sheet that I'm using as a master template. That is, I'm making a copy of this template for every request. I want to add a Google App Script (which onEdit POSTs to my server when the sheeting is completed) to my master template that will be duplicated and run for every copy of this template.

我尝试从管理员帐户执行此操作,但是,脚本似乎并未粘"在任何模板上.这可能吗?

I've tried doing this from an admin account, however, the scripts don't seem to 'stick' with any of the templates. Is this possible?

推荐答案

可将可安装的触发器附加到任何项目的任何电子表格中(尊重共享权限).您可以为制作的每个副本将新的触发器添加到您的母版纸项目.在第二个示例此处,他们建议使用 SpreadsheetApp.openById(),您也可以使用SpreadsheetApp.openByURL()或 Spreadsheet#copy()返回的Spreadsheet,具体取决于您如何复制电子表格.

Installable triggers can be attached to any spreadsheet (respecting sharing permissions) from any project. You can add a new trigger to your master sheets project for each copy that is made. In the second example here they suggest using SpreadsheetApp.openById() you could also use SpreadsheetApp.openByURL() or the Spreadsheet returned by Spreadsheet#copy() depending on how you are duplicating your spreadsheet.

这篇关于如何复制Google工作表并保留其项目触发器和脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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