如何在多个文档中使用谷歌应用脚​​本 [英] How to use a google apps script in multiple documents

查看:94
本文介绍了如何在多个文档中使用谷歌应用脚​​本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个google apps脚本,我想在多个文档中使用。我也可能希望稍后在这些文档中进行更改,所以我必须在所有这些文档中使用相同的脚本,而不是该脚本的副本。

I have a google apps script that I want to use in multiple documents. I also may want to change it later in those documents, so it is imperative that I use the same script in all those documents, and not copies of that script.

我知道下面的问题,它可能有资格作为重复,但我不愿意接受它的答案。

I am aware of the below question, which may qualify as a duplicate, but I am reluctant to accept its answer.

Google Apps脚本 - 如何让一个脚本在多个容器中?

所以,我的问题是:是否真的没有办法在多个Google文档中共享脚本?您是否真的必须为每个文档创建一个新的脚本项目并复制并粘贴另一个脚本的代码?此外,如果您修复其中一个错误,您是否必须记住哪些文档使用该脚本并在其中打开脚本编辑器并复制并粘贴新代码?

So, my question is: is there really no way to share a script among multiple google documents? Must you really create a new script project for every document and copy-and-paste the code from an other? Moreover, if you fix a bug in one of them, do you have to remember which documents use that script and open the script editor in each of them and copy-and-paste the new code?

推荐答案

图书馆是专门针对这种情况设计的......请查看这里的文档

Libraries were designed specifically for this situation... please have a look at the documentation here.

这篇关于如何在多个文档中使用谷歌应用脚​​本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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