[英]Is there a way to use the same google-app-script in multiple different workbooks?
I have created 20+ Goolge Sheets workbooks. 我创建了20多个Goolge Sheets工作簿。 I have also written scripting to run each one. 我还编写了脚本来运行每一个。 The one thing I would love to do is instead of have 20+ codes to run in each one, I would like to have 1 code that was used throughout each of my workbooks. 我想做的一件事就是不要在每一个中运行20多个代码,我希望在我的每个工作簿中都使用一个代码。
Does anyone have any insite on how to make this happpen? 有没有人有任何关于如何使这个开心的问题?
I have tried using the library function. 我试过使用库函数。 I am not sure if I am doing it correctly though. 我不确定我是否正确地做到了。
**//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()" />
Yes, there is. 就在这里。 Publish is as G Suite Editor add-on. Publish是G Suite Editor插件。 For details please read https://developers.google.com/gsuite/add-ons/overview 有关详细信息,请参阅https://developers.google.com/gsuite/add-ons/overview
Related 有关
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.