Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Moved to InDesign Scriptingā
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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