Copy link to clipboard
Copied
Hi all,
My current script produces empty graphic frames on my page, variable quantities and variable sizes.
Does anyone know of a script that would find all objects on this layer (called 'AW') and reduce the height of each one by 10mm from centre, and reduce the width of each one by 10mm from centre? The script must only target the objects on this 'AW' layer due to the other bits going on beforehand.
Any ideas if this is even possible?
Thanks in advance!
Luke
Copy link to clipboard
Copied
var doc = app.activeDocument;
var rects = doc.layers.item("AW").rectangles;
doc.viewPreferences.horizontalMeasurementUnits = doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;
for(var i=0;i<rects.length;i++)
{
var gb = rects.geometricBounds;
rects.geometricBounds = [gb[0]+5,gb[1]+5, gb[2]-5,gb[3]-5];
}
Copy link to clipboard
Copied
It would be better if you use something like this (instead of changing the
geometricBounds):
app.selection[0].resize(CoordinateSpaces.innerCoordinates,
AnchorPoint.TOP_CENTER_ANCHOR,
ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[newWidth, newHeigth]);
Copy link to clipboard
Copied
Hi Luke,
Equalizer settings for your task:
Best,
Marc
Copy link to clipboard
Copied
Wow. What a powerful tool!!!
Great!
Copy link to clipboard
Copied
This is fantastic - Thank you so much everyone