-
Notifications
You must be signed in to change notification settings - Fork 0
/
onOpen.gs
49 lines (41 loc) · 1.55 KB
/
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
40
41
42
43
44
45
46
47
48
49
/**
* Creates a menu entry in the Google Docs UI when the document is opened.
* This method is only used by the regular add-on, and is never called by
* the mobile add-on version.
*
* @param {object} e The event parameter for a simple onOpen trigger. To
* determine which authorization mode (ScriptApp.AuthMode) the trigger is
* running in, inspect e.authMode.
*/
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Smart Data Validation')
.addItem('Set/Update', 'setDv')
//.addItem('Test Trigger', 'test_dvOnEdit')
//.addSeparator()
//.addSubMenu(ui.createMenu('Sub-menu')
// .addItem('Second item', 'menuItem2'))
.addToUi();
// var ui = SpreadsheetApp.getUi();
// ui.createAddonMenu('Smart Data Validation')
// .addItem('Set/Update', 'setDv')
// //.addItem('Test Trigger', 'test_dvOnEdit')
// //.addSeparator()
// //.addSubMenu(ui.createMenu('Sub-menu')
// // .addItem('Second item', 'menuItem2'))
// .addToUi();
}
///**
// * Runs when the add-on is installed.
// * This method is only used by the regular add-on, and is never called by
// * the mobile add-on version.
// *
// * @param {object} e The event parameter for a simple onInstall trigger. To
// * determine which authorization mode (ScriptApp.AuthMode) the trigger is
// * running in, inspect e.authMode. (In practice, onInstall triggers always
// * run in AuthMode.FULL, but onOpen triggers may be AuthMode.LIMITED or
// * AuthMode.NONE.)
// */
//function onInstall(e) {
// onOpen(e);
//}