/** * Creates a Slides API service object and logs the number of slides and * elements in a sample presentation: * https://docs.google.com/presentation/d/1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc/edit */functionlogSlidesAndElements(){constpresentationId='1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc';try{// Gets the specified presentation using presentationIdconstpresentation=Slides.Presentations.get(presentationId);constslides=presentation.slides;// Print the number of slides and elements in presentationconsole.log('Thepresentationcontains%sslides:',slides.length);for(leti=0;i < slides.length;i++){console.log('-Slide#%scontains%selements.',i+1,slides[i].pageElements.length);}}catch(err){// TODO (developer) - Handle Presentation.get() exception from Slides APIconsole.log('FailedtofoundPresentationwitherror%s',err.message);}}