SlidesApp.getActivePresentation() .getSelection() .getCurrentPage() .insertImage(image);
IntegratedApp.insertImage(image);
var IntegratedApp = { // direct mapping to function createAddonMenu: SlidesApp.getUi().createAddonMenu.bind(SlidesApp.getUi()), // wrapper to create consistent behavior across apps insertImage: function(image) { return SlidesApp.getActivePresentation() .getSelection() .getCurrentPage() .insertImage(image); }, // app-specific strings phrases: { docType: 'Slide', name: 'Google Slides', nameWithDocType: 'Google Slides Presentation' } };
insertImage: function(image) { var sheet = SpreadsheetApp.getActiveSheet(); var cell = sheet.getActiveCell(); sheet.insertImage(image, cell.getColumn(), cell.getRow()); }