2 Replies Latest reply: Sep 14, 2012 12:37 PM by acevans001 RSS

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

    acevans001

      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