• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get location of page break in paragraph

Explorer ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

given textFrames[0] -- paragraphs[0] is the first paragraph on the current page

When that paragraph starts on the previous page, is there an easy way to know how many lines of that paragraph are on the previous page, and how many are on the current page?

I assume there's an easy/fast way -- I just can't find it...

Thanks

TOPICS
Scripting

Views

301

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

correct answers 1 Correct answer

Community Expert , Mar 19, 2017 Mar 19, 2017

Given a paragraph myParagraph that breaks across two frames,

myParagraph.parentTextFrames[0].lines.itemByRange(myParagraph.lines[0], myParagraph.parentTextFrames[0].lines[-1]).lines.length

returns the number of lines in the first frame, and

myParagraph.parentTextFrames[1].lines.itemByRange (myParagraph.parentTextFrames[1].lines[0], myParagraph.lines[-1]).lines.length

the number of lines in the second frame.

Peter

Votes

Translate

Translate
Community Expert ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

Given a paragraph myParagraph that breaks across two frames,

myParagraph.parentTextFrames[0].lines.itemByRange(myParagraph.lines[0], myParagraph.parentTextFrames[0].lines[-1]).lines.length

returns the number of lines in the first frame, and

myParagraph.parentTextFrames[1].lines.itemByRange (myParagraph.parentTextFrames[1].lines[0], myParagraph.lines[-1]).lines.length

the number of lines in the second frame.

Peter

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
Explorer ,
Mar 19, 2017 Mar 19, 2017

Copy link to clipboard

Copied

LATEST

Brilliant. Thanks

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