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

Dimension arrows in InDesign

Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Hello,

 

Is anyone aware of a script that will display the length of a line? It would be used to demonstrate height and width in layouts, like dimension arrows do in architectural drawings. I found _Jongware_'s very cool script labelImageSize, but I'd like to use lines that go from edge to edge of an area and are not based on an object.

TOPICS
Scripting

Views

1.8K

Translate

Translate

Report

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 , May 29, 2020 May 29, 2020

Hey,

Because I am writing to the console, that's why Extended Toolkit get open. Try following

#target indesign
var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
alert(length);

 

This will give length of a simple line and display on alert. Try executing this script after saving as a .jsx file.

I am not sure whether it will correct length for double-sided arrow, because I have not tried for double-sided arrow.

 

Votes

Translate

Translate
Community Expert ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Hi,

I am not sure what exactly you mean in detail, but if you want length of simple line that you draw in Indesign, you can calcuate the length using geometricBounds property. Try following snippet and make sure your line is selected in Indesign before running the below code

 

var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
$.writeln(length);

 

Let us know if this is what you required.

 

 

Best regards

Votes

Translate

Translate

Report

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
Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Thank you for your response, Charu. When I save the snippet as a .jsx file and run the script on a selected file, the ExtendScript Toolkit opens up, I assume to debug the script. I don't know very much about scripts, so probably I'm doing something wrong.

 

At any rate, here is the kind of thing I'm looking for:

 

Screen Shot 2020-05-29 at 11.51.58 AM.png

Votes

Translate

Translate

Report

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 ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Hey,

Because I am writing to the console, that's why Extended Toolkit get open. Try following

#target indesign
var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
alert(length);

 

This will give length of a simple line and display on alert. Try executing this script after saving as a .jsx file.

I am not sure whether it will correct length for double-sided arrow, because I have not tried for double-sided arrow.

 

Best regards

Votes

Translate

Translate

Report

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
Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Thank you, Charu, that did execute well:

Screen Shot 2020-05-29 at 1.23.08 PM.png

 

but what I'm looking for is to actually display the measurement on the layout, so that I can create a PDF showing the dimensions for different areas:

 

Screen Shot 2020-05-29 at 1.32.05 PM.png

Votes

Translate

Translate

Report

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 ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Ok, got it what you are looking. So, you have drawn this box using single lines. Well, this required more of scripting, If I have updated one, I will share with you soon.

 

Best regards

Votes

Translate

Translate

Report

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
Explorer ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

Thank you for your interest!

Votes

Translate

Translate

Report

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
Enthusiast ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

I just finished a script that does this. Posted this morning.

https://www.marspremedia.com/software/indesign/dimensions-indesign

William Campbell

Votes

Translate

Translate

Report

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
Explorer ,
May 11, 2021 May 11, 2021

Copy link to clipboard

Copied

LATEST

Wow, how cool! Thanks for letting me know. I will check it out.

Votes

Translate

Translate

Report

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