Copy link to clipboard
Copied
How can I get width that multiple selected items? (Not grouped.)
//---------- source code ----------
var mm = 2.83464566929134 //unit conversion. (point->milimeter)
var W = docRef.selection[0].width/mm;
alert(W);
//---------- source code ----------

check this thread, there's a sample by pixxxel
Copy link to clipboard
Copied
check this thread, there's a sample by pixxxel
Copy link to clipboard
Copied
That's right Carlos ![]()
@kimDino8,
my script in Carlos link creates a green rectangle around the selected items. If you don't need this rectangle than you can remove this lines:
var newRGBColor = new RGBColor();
newRGBColor.red = 0;
newRGBColor.green = 255;
newRGBColor.blue = 0;
and replace this:
var aRectangle = aDoc.pathItems.rectangle(vBounds_Ob, vBounds_Li, vBounds_Re - vBounds_Li, vBounds_Ob - vBounds_Un);
aRectangle.strokeColor = newRGBColor;
aRectangle.strokeWidth= 2;
aRectangle.filled = false;
aRectangle.stroked = true;
aDoc.selection = null;
with this:
var mmFactor = 2.83464567;
alert("width = "+ (vBounds_Re - vBounds_Li)/mmFactor);
alert("height = "+ (vBounds_Ob - vBounds_Un)/mmFactor);
Further you only have to do: create a function for rounding of the result.
![]()
Copy link to clipboard
Copied
Thank you.
I made it!!! ![]()
Find more inspiration, events, and resources on the new Adobe Community
Explore Now