Skip to main content
Participant
November 22, 2018
Question

InD Reflowable ePub Export: Find Non-Rectangular Object?

  • November 22, 2018
  • 4 replies
  • 732 views

Hi, this isn't a huge deal, but I'm wondering if there is procedure to find a Non-Rectangular Object in an .indd file?

Of course I could go page by page, and will, but it's 245 page book, and it would be good to know for next time when my boss hands me a file with 30 billion  of them...

I know that I'm probably overlooking something obvious, so I appreciate your patience and insight

InDesign CC v.14.0.1

This topic has been closed for replies.

4 replies

Peter Kahrel
Community Expert
Community Expert
November 28, 2018

Rectangular objects should be easy to find. They are objects with a single path whose entirePath has four elements. These elements are coordinate pairs, and comparing the pairs tells you whether the path segments are straight lines and whether the rectangle has right angles (if that matters).

If 'obj' is an object, then

if (obj.hasOwnProperty('paths') && obj.paths.length == 1 && obj.paths[0].entirePath.length == 4) {

   // obj is a rectangle

}

Suppose you have a frame with its top left at 120,100, is 150 wide and 200 high, then (with the frame selected)

app.selection[0].paths[0].entirePath.join('\r');

100,120

100,320

250,320

250,120

This shows that the selected frame is a rectangle with right angles.

P.

Community Expert
November 28, 2018

Hi Peter,

I think our OP is waiting for a complete script :-)

Since we do know next to nothing about the document I'd rather wait as well before doing suggestions.

We could try to exclude rectangular objects with four path points and four elements in entirePath, yes.

But I hope we can get more information what specific thing should be found.

All non-rectangular objects in the document? Just a specific kind?

Regards,
Uwe

Srishti Bali
Legend
November 27, 2018

Moved to InDesign Scripting

Community Expert
November 22, 2018

Can you show a screenshot of such an object selected?
Frame edges should show, and the Layers panel should show the selected object as well.

Regards,
Uwe

Community Expert
November 22, 2018

Hi TPH17 ,

that is something only a script can do.

No easy task, though…

Hm. Maybe the objects you'd like to find have also other properties in common?

Stroke weight, stroke color, fill color?

Regards,
Uwe