-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathonOpen.gs
39 lines (32 loc) · 889 Bytes
/
onOpen.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function onInstall(e) {
onOpen();
}
function onOpen(e) {
SpreadsheetApp.getUi().createAddonMenu()
.addItem("Show Sidebar", "doGet")
.addToUi();
};
function doGet(e) {
var html = HtmlService.createTemplateFromFile('Sidebar')
.evaluate();
html
.setTitle('Portfolio')
.setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
.showSidebar(html);
}
function showPicker() {
const html = HtmlService.createHtmlOutputFromFile('Picker.html')
.setWidth(1051)
.setHeight(650)
.setTitle('Pick a form to import to Portfolio');
SpreadsheetApp.getUi().showModalDialog(html, 'Pick a form to import to Portfolio');
}
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
function getOAuthToken() {
DriveApp.getRootFolder();
return ScriptApp.getOAuthToken();
}