Google apps script 有没有办法在多个不同的工作簿中使用相同的谷歌应用程序脚本?
我已经创建了20多个Goolge Sheets工作簿。我还编写了脚本来运行每一个。我想做的一件事是,我不想在每一本中运行20多个代码,而是希望在我的每一本工作簿中都使用1个代码 有人对如何实现这一点有什么见解吗 我尝试过使用库函数。不过,我不确定我是否做对了Google apps script 有没有办法在多个不同的工作簿中使用相同的谷歌应用程序脚本?,google-apps-script,google-sheets,google-apps-script-addon,Google Apps Script,Google Sheets,Google Apps Script Addon,我已经创建了20多个Goolge Sheets工作簿。我还编写了脚本来运行每一个。我想做的一件事是,我不想在每一本中运行20多个代码,而是希望在我的每一本工作簿中都使用1个代码 有人对如何实现这一点有什么见解吗 我尝试过使用库函数。不过,我不确定我是否做对了 **//This is my Menu//** function onOpen() { var submenu = [{name: "Submit Order", functionName: "SubmitOrder"}, {name:
**//This is my Menu//**
function onOpen() {
var submenu = [{name: "Submit Order", functionName: "SubmitOrder"},
{name: "Recommended Order", functionName: "myRecommendations"},{name: "Clear Entire Form", functionName: "ClearAllCells"},
{name: "Clear Product Information", functionName: "ClearProductCells"},{name: "Notifications", functionName: "showSidebar"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('OTSR Tools', submenu);
}
function showSidebar() {
var html = HtmlService.createHtmlOutputFromFile('Page')
.setTitle('Notifications')
.setWidth(500);
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showSidebar(html);
}
**//This is the HTML for my Sidebar//**
Hello everyone,<br>
Your quote of the week is...<br>
<br>
<i>"Our greatest weakness lies in giving up. <br>
The most certain way to succeed is always to try just one more time."</i><br>
<br>
Thomas A. Edison<br>
<br>
If there are any updates they will be found below.<br>
<br>
This is a Test!!!!!!!!!<br>
<br>
Thank you,<br>
<br>
Jason Mattson<br>
Back-End Support"<br>
<br>
<input type="button" value="Close" onclick="google.script.host.close()" />
**//这是我的菜单//**
函数onOpen(){
var子菜单=[{name:“提交顺序”,functionName:“提交者”},
{name:“推荐顺序”,functionName:“MyRecommensions”},{name:“清除整个表单”,functionName:“ClearAllCells”},
{name:“清除产品信息”,functionName:“ClearProductCells”},{name:“通知”,functionName:“showSidebar”}];
SpreadsheetApp.getActiveSpreadsheet().addMenu(“OTSR工具”子菜单);
}
函数showSidebar(){
var html=HtmlService.createHtmlOutfromfile('页面')
.setTitle(“通知”)
.设置宽度(500);
SpreadsheetApp.getUi()//或DocumentApp或SlideApp或FormApp。
.showSidebar(html);
}
**//这是我的侧边栏的HTML//**
大家好,
您本周的报价是…
“我们最大的弱点在于放弃。
成功最可靠的方法就是再尝试一次。”
托马斯·爱迪生
如果有任何更新,将在下面找到。
这是一个测试
谢谢你,
杰森·马特森
后端支持“
是的,有。发布为G套件编辑器附加组件。有关详细信息,请阅读
相关的