将Google脚本项目从电子表格复制到另一个 [英] Copy a google script project from a Spreadsheet to another

查看:65
本文介绍了将Google脚本项目从电子表格复制到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到了许多有关如何使用脚本将工作表复制到Google Spreadsheets中的另一个Spreadsheet的答案,例如

I've seen many answers about how to use scripts to copy sheets to another Spreadsheet in Google Spreadsheets, such as this copyTo method.

但是现在我有一个包含许多选项卡的大型电子表格,并且使用绑定脚本中的更新创建了它的新版本.这个新表中的数据是测试数据.这就是我所拥有的:

But now I have a big spreadsheet with many tabs, and I created a new version of it with updates in the bound scripts. The data in this new sheet is test data. So this is what I have:

  • 旧电子表格文件(一致的数据)/旧脚本项目(已过时)
  • 新电子表格(测试数据)/新脚本项目(当前)
  • Old spreadsheet file (consistent data) / Old script project (obsolete)
  • New spreadsheet (test data) / New script project (current)

然后我需要将新的脚本项目复制到旧的电子表格(具有一致的数据).

I need then to copy the new script project to the old spreadsheet (which has the consistent data).

我知道我可以努力复制每张纸,但这实际上不是这里的问题(此外,还会给命名范围带来很多麻烦).问题是如何将脚本项目复制到另一个电子表格.

I know I could make an effort to copy each sheet instead, but that is really not the question here (besides also creating lots of trouble with named ranges). The question is how to copy the script project to another spreasheet.

推荐答案

我认为 Google Clasp 工具可以帮助您实现自动化.我开始使用它,它的前景很好.例如,您可以在不同的文件夹上发布旧项目和新项目的clasp clone [scriptId].然后,您可以将所有新脚本文件复制到旧文件夹,然后发出clasp push.但是,由于我不是专家,所以建议您在概念验证中进行测试:)

I think the Google Clasp tool can help you automate this. I'm starting to use it and it's promising. For instance you may issue a clasp clone [scriptId] of both old and new projects on different folders. Then you can copy all your new scripts files to the old folder and then issue a clasp push. But since I'm not a clasp expert I suggest you tests this on a proof of concept :)

编辑(2019-06-21): 使用该产品几个月后,我确认此方法效果很好.

Edit (2019-06-21): After using the product for several months I confirm that this approach works very well.

这篇关于将Google脚本项目从电子表格复制到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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