如何为我的所有 Google 电子表格提供一组脚本? [英] How to make set of scripts available for all my Google Spreadsheets?

查看:21
本文介绍了如何为我的所有 Google 电子表格提供一组脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 Docs 中做类似的事情,即有一组脚本,无论我打开哪个 Google 电子表格,都会导致运行 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 电子表格中执行此操作.但是最好的做法是

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

  1. 使用 onOpen 和其他函数编写独立脚本.
  2. 将此发布为图书馆
  3. 在您创建的每个电子表格中编写一个 shell onOpen手动.:( 这个 shell 函数将调用库的 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 电子表格提供一组脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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