Skip to content

Commit 32e6a9f

Browse files
committed
Move slides thumbnail to advanced folder
1 parent d56f005 commit 32e6a9f

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

advanced/slides.gs

+18
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,21 @@ function formatShapeText(presentationId, shapeId) {
152152
Slides.Presentations.batchUpdate({'requests': requests}, presentationId);
153153
}
154154
// [END apps_script_slides_format_shape_text]
155+
156+
// [START apps_script_slides_thumbnail]
157+
/**
158+
* Saves a thumbnail image of the current Google Slide presentation in Google Drive.
159+
* Logs the image URL.
160+
* @param {number} i The zero-based slide index. 0 is the first slide.
161+
* @example saveThumbnailImage(0)
162+
*/
163+
function saveThumbnailImage(i) {
164+
var presentation = SlidesApp.getActivePresentation();
165+
var thumbnail = Slides.Presentations.Pages.getThumbnail(
166+
presentation.getId(), presentation.getSlides()[i].getObjectId());
167+
var response = UrlFetchApp.fetch(thumbnail.contentUrl);
168+
var image = response.getBlob();
169+
var file = DriveApp.createFile(image);
170+
Logger.log(file.getUrl());
171+
}
172+
// [END apps_script_slides_thumbnail]

slides/thumbnail/thumbnail.gs

-15
This file was deleted.

0 commit comments

Comments
 (0)