-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUIObj.gs
38 lines (35 loc) · 1.27 KB
/
UIObj.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
/**
* Object used to display content via Google Apps Script's built-in UI features.
*/
const UIObj = new (function() {
let _Ui = SpreadsheetApp.getUi();
/**
* Creates a menu in the spreadsheet with three buttons: one to check the user's
library for media items in more than one album, one to check the user's library
for media items that are not in an album, and one containing text about the
program.
*/
this.intializeMenu = () => {
_Ui.createMenu('Photo Sorter')
.addItem('Write Isolated Media to Sheet', 'writeIsolatedMediaToSheet')
.addItem('Check Library for Duplicates', 'checkLibraryForDuplicates')
.addSeparator()
.addItem('About','displayAboutText')
.addToUi();
};
/**
* Displays an alert in the Google Sheets window.
* @param {string} message Text to display in alert window.
*/
this.displayAlert = (message) => {
_Ui.alert(message);
};
})();
/**
* Displays the program's 'About' text in the Google Sheets window.
*/
function displayAboutText(){
let aboutText = "Code written by Luis DaSilva in 2022. See my website at www.luisdasilva.net for more content! " +
"More also available on my Github at https://github.com/luisdasilva-contact."
UIObj.displayAlert(aboutText);
};