简体   繁体   English

如何将脚本从一个电子表格复制到另一电子表格?

[英]How do I copy a script from one spreadsheet to another spreadsheet?

I need to copy an existing script, which I did not write, into my existing spreadsheet. 我需要将没有写的现有脚本复制到现有电子表格中。 The script is called "SaveBack", and can be found here: https://docs.google.com/a/levelgroup.com/spreadsheet/ccc?key=0Agcb8bUVVOOodHhoV3BrRGZ6UEdSYnVLSEk3bllxRnc#gid=1 . 该脚本称为“ SaveBack”,可以在以下位置找到: https ://docs.google.com/a/levelgroup.com/spreadsheet/ccc?key=0Agcb8bUVVOOodHhoV3BrRGZ6UEdSYnVLSEk3bllxRnc#gid =1

My existing spreadsheet is too complex (it has many other spreadsheets that link to it) to copy all of its sheets into the spreadsheet that contains the script. 我现有的电子表格太复杂了(它有许多其他电子表格链接到它)以至于无法将其所有工作表复制到包含脚本的电子表格中。 I have already copied the SaveBack editor sheet template sheet to my main spreadsheet, but I can't figure out how to copy the SaveBack script that goes along with it into my spreadsheet. 我已经将SaveBack编辑器工作表模板工作表复制到了我的主电子表格中,但是我不知道如何将随附的SaveBack脚本复制到我的电子表格中。

Can anyone help? 有人可以帮忙吗? Thanks! 谢谢!

Open the save back script, select the script text, copy it, go to your sheet, create a new script (blank template), paste the script you copied into your new script, name is SaveBack (assuming it's a project), check the triggers on the original script and make sure your triggers match, and you should be good to go. 打开保存回脚本,选择脚本文本,将其复制,转到工作表,创建一个新脚本(空白模板),将复制的脚本粘贴到新脚本中,名称为SaveBack(假设它是一个项目),检查原始脚本上的触发器,并确保触发器匹配,那么您应该一切顺利。 You will have to change any sheet, document, or other string ID's to match your files' Id's, but that isn't too bad. 您将必须更改任何工作表,文档或其他字符串ID以匹配文件的ID,但这还不错。

I do this sort of thing all of the time when I'm migrating things back and forth between my work and personal account. 当我在工作和个人帐户之间来回迁移时,我总是会做这种事情。 You could also create a copy of the other person's spreadsheet that you linked above, and it will move the script over with it. 您也可以在上面链接的其他人的电子表格中创建一个副本,它会将脚本移到上方。 Then you can go to the script and get the project key to use it as library in your own scripts. 然后,您可以转到脚本并获取项目密钥,以将其用作您自己的脚本中的库。 Since you're using your copy as the library, you don't have to worry about someone else changing the script and breaking your functionality. 由于您将副本用作库,因此不必担心其他人更改脚本并破坏功能。

暂无
暂无

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

相关问题 如何使用谷歌应用脚本将一行从一个谷歌电子表格复制到另一个谷歌电子表格? - How to copy a row from one google spreadsheet to another google spreadsheet using google apps script? 如何使用应用程序脚本将值从一个子文件夹中的某些电子表格复制到另一电子表格 - How can I copy values from some spreadsheets that are in one subfolder to another spreadsheet with app script Google Apps脚本:如何从一个电子表格中提取今天输入的数据并将其转换为另一电子表格? - Google Apps Script: How do I pull data entered today from one spreadsheet and transpose it to another? Google Apps 脚本,将一个电子表格复制到另一个带格式的电子表格 - Google Apps Script, copy one spreadsheet to another spreadsheet with formatting 如何使用带有事件的谷歌应用脚本将单行中的特定列从一个谷歌电子表格复制到另一个谷歌电子表格? - How to copy specific columns from a single row from one google spreadsheet to another google spreadsheet using google apps script with an event? 将过滤后的范围从一个电子表格复制到另一个 - Google 应用脚本 - Copy filtered range from one spreadsheet to another - Google app script CopyTo:如何使用Google Apps脚本将数据从一个Google电子表格推入/复制单元格到另一个Google电子表格? - CopyTo: How to push data/copy a cell from one google spreadsheet to another google spreadsheet using google apps script? 将多个工作表从一个电子表格复制到另一个电子表格 - Copy several sheets from one spreadsheet to another spreadsheet 将动态范围从一个电子表格复制到另一个使用getfileid调用的电子表格 - copy dynamic range from one spreadsheet to another spreadsheet called with getfileid 将谷歌脚本项目从电子表格复制到另一个 - Copy a google script project from a Spreadsheet to another
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM