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.
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.geometricBounds - app.selection.geometricBounds $.writeln(length);
Let us know if this is what you required.
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:
Because I am writing to the console, that's why Extended Toolkit get open. Try following
#target indesign var length = app.selection.geometricBounds - app.selection.geometricBounds 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.
Thank you, Charu, that did execute well:
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:
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.
Thank you for your interest!
Wow, how cool! Thanks for letting me know. I will check it out.