giorgian
giorgian

Reputation: 3825

Determine if splitting two TextFrames will split a paragraph in InDesign

TextFrame#nextTextFrame tells me if a TextFrame overflows; I can also split the two TextFrames the way StorySplitter does.

What I can't seem to figure out is: does the second TextFrame start with a new paragraph, or does a single paragraph extend between the two?

I need this in order to reconstruct the flow afterwards, externally: I need to know if I have to merge the last paragraph of the first TextFrame and the first paragraph of the second TextFrame, or if instead they are two distinct paragraphs.

Upvotes: 1

Views: 181

Answers (1)

Josh Voigts
Josh Voigts

Reputation: 4132

They would be considered the same Paragraph object. You can test this yourself with something similar to the following code (assuming there is a paragraph that spans two text frames and the text frames are linked together).

var doc = app.activeDocument;

var frame1 = doc.pages[0].textFrames[0];
var frame2 = frame1.nextTextFrame;

var para1 = frame1.paragraphs.lastItem();
var para2 = frame2.paragraphs.firstItem();

alert(para1 === para2);

Upvotes: 2

Related Questions