In this tutorial, Sergei Prokhnevskiy will show you how to automatically get the size of many layers using expressions in After Effects. Click here to learn more about expressions.
Code:
keyword = “ukramedia”;
widthList = [];
for(i = 1; i <= thisComp.numLayers; i++) {
layerPath = thisComp.layer(i);
layerWidth = layerPath.sourceRectAtTime().width;
if(layerPath.name.match(keyword)) {widthList.push(layerWidth)} else {};
}
Math.max(…widthList) + 100