如何使所有我的Google Spreadsheets都可以使用一组脚本? [英] How to make set of scripts available for all my Google Spreadsheets?

查看:78
本文介绍了如何使所有我的Google Spreadsheets都可以使用一组脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Excel支持PERSONAL.XLS文件的概念,该文件包含我的个人脚本,我希望该脚本可以在我打开的任何电子表格/工作簿上使用.

Excel supports the concept of a PERSONAL.XLS file which contains my personal scripts, which I want to be able to use on any spreadsheet/workbook that I open.

我如何在Google文档中执行类似操作,即拥有一组脚本,无论我打开哪个Google Spreadsheet,这些脚本都会导致运行onOpen事件并因此添加我的额外菜单?

How do I do similar in Google Docs, i.e. have a set of scripts which, regardless of which Google Spreadsheet I open, will cause the onOpen event to be run and will thus add my extra menu?

推荐答案

您不能在Google Spreadsheets中执行此操作.但是,最佳做法是

You cannot do that in Google Spreadsheets. However the best practice is to

  1. 用onOpen和其他功能编写一个独立的脚本.
  2. 将其发布为图书馆
  3. 在您创建的每个电子表格中的onOpen上编写一个shell onOpen 手动. :(此shell函数将调用库的onOpen.​​
  1. Write a standalone script with your onOpen and other functions.
  2. Publish this as a library
  3. Write a shell onOpen in each of the spreadsheets that you create manually. :( This shell function will call the library's onOpen.

但是,如果您创建具有关联脚本的电子表格的副本,则该副本中也将包含脚本.

However, if you create a copy of a spreadsheet that has an associated script, then the copy will also have the script in it.

这篇关于如何使所有我的Google Spreadsheets都可以使用一组脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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