Reply To: Exact size Image frame dimensions script

#1240708
Brian Pifer
Participant

Correct, just something to started on the UI. From there, it would be a matter of resizing the rectangles and their containing images.

app.selection returns an array of all the selected objects on a page. If you select a frame with your black arrow tool, that’s a rectangle object. With one object selected:

var rect = app.selection[0];
var containingImage = rect.graphics[0];

You can look at the rect.geometricBounds property, as well as rect.resize() and rect.fit() methods. Lots of different ways to skin the cat based on your ultimate needs and how your doc is set up.

For some guidance on the Rectangle object, https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Rectangle.html

This article was last modified on April 27, 2020

Comments (0)

Loading comments...