使用Google Drive SDK在Google Spreadsheet脚本中激活触发器 [英] Activating Triggers in Google Spreadsheet Scripts with Google Drive SDK
本文介绍了使用Google Drive SDK在Google Spreadsheet脚本中激活触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
换句话说,是否有办法:
- 创建一个新的Google电子表格(来自Google Drive API) >
- 然后以编程方式创建与Google Spreadsheet相关的Google Apps脚本 然后以编程方式激活On Edit和On Form Submit Triggers 在脚本中调用各种方法? (这是我找不到的部分)
- 使用所需脚本手动创建电子表格
- 使用Google Drive API以编程方式复制电子表格用脚本也可以)
- 以某种方式以编程方式激活On Edit和On Form Submit Triggers(不要复制复制电子表格,这是部分我找不到) 可能的路径如下:
- Create a new Google Spreadsheet (from the Google Drive API)
- And then create a Google Apps Script associated with that Google Spreadsheet programmatically
- And then programmatically activate the "On Edit" and "On Form Submit Triggers" to call various methods in the script? (this is the part I cannot figure out)
- Manually create a spreadsheet with the desired script
- Use the Google Drive API to programmatically copy the spreadsheet (which copies with script with it as well)
- Somehow programmatically activate the "On Edit" and "On Form Submit Triggers" (which DO NOT copy over from copying the spreadsheet, this is the part I cannot figure out)
使用电子表格中的onOpen()触发器创建容器绑定脚本。
复制现有的电子表格以编程方式复制脚本。
以编程方式打开新的电子表格(不确定这是否会启动上述触发器)。
这假设了几件事情,但似乎是值得的调查。我很好奇这是否有效。祝你好运。
Phrased another way, is there a way to:
-OR- (as @JacobFlatter suggested)
解决方案
Possible path to follow:
Create a container bound script with an onOpen() trigger within a spreadsheet.
Copy the existing Spreadsheet (which will copy the script as well) programmatically.
Open the new Spreadsheet programmatically (unsure if this will initiate the trigger described above).
This assumes a few things, but seems like it is worth investigating. I'm curious if this works. Good Luck.
这篇关于使用Google Drive SDK在Google Spreadsheet脚本中激活触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文