Mobile app version of vmapp.org
Login or Join
Cooney243

: Illustrator: script to normalize size of paths I have quite a few irregular paths (approx. 200), each with a different bounding box. I want scale all of these to a similar size. It is possible

@Cooney243

Posted in: #Adobe #AdobeIllustrator #Illustration #IllustratorScripting

I have quite a few irregular paths (approx. 200), each with a different bounding box. I want scale all of these to a similar size. It is possible ?

This:



Change to this automatically:

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney243

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gail6891361

Select objects you want to fit by height and run:
#target illustrator

// ScaleToFitVerticalAxis.jsx
//
// Copyright (c) 2017 Janne Ojala
//
// Licence: opensource.org/licenses/MIT
visitObjects(app.activeDocument.selection, scaleByHeight, 100)

function scaleByHeight(item, targetHeight){
var factor = targetHeight / item.height;
item.height *= factor;
item.width *= factor;
}

function visitObjects(sel, func, opts) {
for(var i = 0; i < sel.length; i++){
func(sel[i], opts);
}
}


Example:



Image 1: Objects on first row are scaled to fit by height on second row.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme