Ok, so I am trying to write a script that resizes an object that is selected. I have two objects selected, the one on top is a group item, the one below it is a rectangle. I am trying to resize the rectangle to the size of the group item on top of it with a little margin around it. Here is what I have so far.
var design = app.activeDocument.selection;
var background = app.activeDocument.selection;
background.position = (top, left, width, height);
The problem is the last line there. I'm not sure how to manipulate the position/size of the selected object or if it is even possible I have searched for it and haven not found an answer. Thanks in advance!
position property expects an Array, with x and y values, in that order. As for the width and height properties, use them in separate statements
background.position = [left, top]; background.width = width; background.height = height;
Awesome, thanks for the help it works great!