简体   繁体   English

导出Google Spreadsheet和相关脚本

[英]Export Google Spreadsheet and related scripts

I have a Google SpreadSheet with some custom scripts to do stuffs. 我有一个Google SpreadSheet,其中包含一些自定义脚本来执行操作。

Is there a way to export the "bundle" (sheets+scripts), so that if I import the file (on another folder/Drive) I'll get a clone (sheets+scripts) of the original? 有没有一种方法可以导出“捆绑包”(表格和脚本),因此,如果导入文件(在另一个文件夹/驱动器上),我将获得原始文件的副本(表格和脚本)? Looks like it is possible to only export the SpreadSheet. 看起来只能导出SpreadSheet。

EDIT: 编辑:

To better explain the scenario, I'd like to export spreadsheet+script to use a local version control system to better "log" my development. 为了更好地说明这种情况,我想导出电子表格+脚本以使用本地版本控制系统来更好地“记录”我的开发。 The Google script version control is not enough detailed for my purpose. Google脚本版本控制不够详细,无法满足我的目的。 If one can download/upload linked spreadsheet/script (also forma/script) it will be quite handy. 如果可以下载/上传链接的电子表格/脚本(也包括格式/脚本),它将非常方便。

You can't really export/import your "bundle" like export it as file and import it again. 您实际上不能像将其导出为文件然后再次导入一样来导出/导入您的“捆绑包”。

But when you make a copy of a spreadsheet, you also copy the script related to this sheet. 但是,当您复制电子表格的副本时,您还复制了与此工作表相关的脚本。 So you can make a workaround by using the method to copy a file( copy() ), and change the owner of it ( setOwner() ). 因此,您可以使用该方法复制文件( copy() )并更改其所有者( setOwner() )来解决。 You'll keep the sheet with the script related and it will be transfered. 您将在工作表中保留与脚本相关的内容,并将其转移。

If the script is bound to the spreadsheet then any copies of the sheet will also have their own copies of the script. 如果脚本绑定到电子表格,则工作表的任何副本也将拥有自己的脚本副本。 If you need to copy the sheet to a different GDrive account just share the sheet with that account (granting edit access) and the user of that account can make their own copy of the sheet. 如果您需要将工作表复制到其他GDrive帐户,只需与该帐户共享工作表(授予编辑权限),该帐户的用户即可制作自己的工作表副本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM