Skip to main content
AYS__HAKKIM
Inspiring
May 22, 2009
Question

How can resize an image proportionally?

  • May 22, 2009
  • 1 reply
  • 1773 views

Hi all

I'm new to illustrator script and now I've a need that I've to resize the image proportionally through javascript. That is if I change the width it should reduce height proportionally.

thanks

Hakkim

This topic has been closed for replies.

1 reply

May 22, 2009

For paths and groups, use the resize method.  Something along the lines of:

ScaleX = ScaleY;

app.activeDocument.layer.pathItem.resize(ScaleX,ScaleY);

OR

app.activeDocument.layer.groupItem.resize(ScaleX,ScaleY);

ScaleX and ScaleY are percentages (0-100).

There's some more information in the Javascript Reference under pathItem methods and groupItem methods.