-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCode.gs
More file actions
29 lines (27 loc) · 729 Bytes
/
Code.gs
File metadata and controls
29 lines (27 loc) · 729 Bytes
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
const doGet = (_) => HtmlService.createHtmlOutputFromFile("index");
function getImages() {
return SlidesApp.getActivePresentation()
.getSlides()
.map((e) =>
e.getImages().length > 0 ? e.getImages()[0].getContentUrl() : ""
)
.filter(String);
}
function appendImages(images) {
const s = SlidesApp.getActivePresentation();
images.forEach((e) => {
const image = s
.appendSlide()
.insertImage(
Utilities.newBlob(
Utilities.base64Decode(e.data),
e.mimeType,
e.fileName
)
);
image.setTitle(e.fileName);
image.setDescription(new Date().toISOString());
});
s.saveAndClose();
return getImages();
}