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

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

问题描述

我有一个 google 应用程序脚本,我想在多个文档中使用它.我可能还想稍后在这些文档中更改它,因此我必须在所有这些文档中使用 相同 脚本,而不是该脚本的副本.

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 脚本 - 如何使用多个容器中的一个脚本?

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

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天全站免登陆