I want to set the size of all elements as the size of the first selected element. but seems something wrong with my code , somehow first element size not working for others.
Please see attached script
/*
* Make all elements same size
*/
function sameSizeElements() {
var selection = SlidesApp.getActivePresentation().getSelection();
var selectionType = selection.getSelectionType();
var pageElements = selection.getPageElementRange().getPageElements();
//iterate the selected page elements to grab the values of each positiion
for (var i = 0; i < pageElements.length; i++) {
if(i != 0){
pageElements[i].setWidth(pageElements[0].getWidth());
pageElements[i].setHeight(pageElements[0].getHeight());
}
}
}
Here is the full code you can put in ScriptEditor > code.js default file and refresh slide. it will work as you want to debug.
Updated
We are in the discussion with Google App Script issue tracking team - https://issuetracker.google.com/issues/162545277