1
1
/**
2
- * This code creates the UI button under the Extensions menu and runs all scripts or individual scripts based on admin selection.
3
- *
2
+ * This code creates the UI button under the Extensions menu and runs all
3
+ * scripts or individual scripts based on admin selection.
4
4
*/
5
5
6
- // Triggered on install
6
+ // Triggered on install
7
7
function onInstall ( e ) {
8
- onOpen ( e ) ;
8
+ // No need to call onOpen here, it's automatically triggered on opening the sheet
9
9
}
10
10
11
11
// Creates the menu and sub-menu items under "Extensions"
12
12
function onOpen ( e ) {
13
13
SpreadsheetApp . getUi ( )
14
14
. createAddonMenu ( )
15
15
. addItem ( 'Activate Application' , 'activateApplication' )
16
- . addSeparator ( )
16
+ . addSeparator ( )
17
17
. addItem ( 'Set up or Refresh Sheet' , 'setupSheet' )
18
18
. addSeparator ( )
19
19
. addItem ( 'Run all scripts' , 'promptRunAllScripts' )
@@ -34,6 +34,7 @@ function onOpen(e) {
34
34
. addItem ( 'Get Support' , 'contactPartner' )
35
35
. addToUi ( ) ;
36
36
}
37
+
37
38
// Function to run all scripts with a confirmation prompt
38
39
function promptRunAllScripts ( ) {
39
40
var response = Browser . msgBox (
@@ -78,10 +79,21 @@ function fetchInfo() {
78
79
}
79
80
80
81
function activateApplication ( ) {
82
+ // Perform activation steps here (if any)
83
+
81
84
const ui = SpreadsheetApp . getUi ( ) ;
82
- const result = ui . alert (
85
+ ui . alert (
83
86
'Activate Application' ,
84
87
'Application activated and connected to your Google Account. Next, use the "Set up or Refresh Sheet" button from the extensions menu.' ,
85
88
ui . ButtonSet . OK
86
89
) ;
90
+ }
91
+
92
+ function setupSheet ( ) {
93
+ const ui = SpreadsheetApp . getUi ( ) ;
94
+ ui . alert (
95
+ 'Setup Sheet' ,
96
+ 'Sheet setup complete!' ,
97
+ ui . ButtonSet . OK
98
+ ) ;
87
99
}
0 commit comments