• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

InD Reflowable ePub Export: Find Non-Rectangular Object?

Community Beginner ,
Nov 21, 2018 Nov 21, 2018

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

TOPICS
Scripting

Views

484

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 ,
Nov 22, 2018 Nov 22, 2018

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

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 ,
Nov 22, 2018 Nov 22, 2018

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

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
Adobe Employee ,
Nov 27, 2018 Nov 27, 2018

Copy link to clipboard

Copied

Moved to InDesign Scriptingā€‹

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 ,
Nov 28, 2018 Nov 28, 2018

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.

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 ,
Nov 28, 2018 Nov 28, 2018

Copy link to clipboard

Copied

LATEST

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

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