Skip navigation
acevans001
Currently Being Moderated

Is it possible to modify this script to make objects same width or height?

Sep 13, 2012 8:09 AM

Tags: #script #height #width

I found this script that makes the selected objects the same width AND height. I am very new to creating scripts. is it possible to modify this to make an object the same width leaving their heights the same?

 

 

mySelection = activeDocument.selection;

if (mySelection.length>0){

if (mySelection instanceof Array) {

goal=mySelection[mySelection.length-1];

for (i=0; i<(mySelection.length-1); i++){

  ratioW = 100/(mySelection[i].width/goal.width);

  ratioH = 100/(mySelection[i].height/goal.height);

  mySelection[i].resize(ratioW,ratioH)

}

}

}else{

alert("Nothing selected!")

}

 

 

thanks in advance

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points