ExtendScript – Illustrator : Change item size

How to change size of layer in illustrator with ExtendScript

This function takes in a layer and a size % for that layer. Then it scales it for you.

//pass in your item to resize. Pass in the % of size you want it to be
resizeImage(itemToPlace, 20)
function resizeImage (resizeThis, scale){
resizeThis.resize(
scale , // x
scale , // y
true, // changePositions
true, // changeFillPatterns
true, // changeFillGradients
true, // changeStrokePattern
scale , // changeLineWidths <—- NOTE THIS
undefined); // scaleAbout
}//
//end function

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s