Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I get width that multiple selected items?

Community Beginner ,
Apr 23, 2013 Apr 23, 2013

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 ----------

width.jpg

TOPICS
Scripting
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 24, 2013 Apr 24, 2013

check this thread, there's a sample by pixxxel

http://forums.adobe.com/message/5213407#5213407

Translate
Adobe
Community Expert ,
Apr 24, 2013 Apr 24, 2013

check this thread, there's a sample by pixxxel

http://forums.adobe.com/message/5213407#5213407

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2013 Apr 24, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2013 Apr 25, 2013
LATEST

Thank you.

I made it!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines