Bulk aligning and sorting a selection of objects?
I'm looking to left align a selection of objects which have been scaled as part of a script then distribute the spacing at a set amount of 14.1732p
Is there a way to rearrange the selection into columns of objects if over a certain amount?
eg. rows of 7?
Below is the code from another thread adjust to individually re-size the objects proportionally if over a max dimension.
function scaleDownProportionally(item, maxSize) {
var W = item.width,
H = item.height,
MW = maxSize.W,
MH = maxSize.H,
factor = W / H > MW / MH ? MW / W * 100 : MH / H * 100;
if (W > MW || H > MH) {
item.resize(factor, factor);
}
}
for (var i = 0; i < app.selection.length; i++) {
scaleDownProportionally(app.selection[i], {W: 853.228, H: 127.559});
}