Skip to main content
mircea_nicolae
Participant
November 3, 2014
Question

unable to get endHorizontalOffset property of a paragraph

  • November 3, 2014
  • 1 reply
  • 330 views

Hi,

In a script when cycling through paragraphs, I get a "The property is not applicable in the current state" when trying to

alert(paragraph.endHorizontalOffset);

alert(paragraph.endBaseline);

All the other paragraphs are working fine.

I can see the contents of the paragraph, it's baseline and horizontalOffset but not those to properties.

Also the error is not catchable.

I also cannot see to be able to get the endBaseline and endHorizontalOffset for any of the words from that paragraph

Any clues?

Thanks

This topic has been closed for replies.

1 reply

TᴀW
Legend
November 3, 2014

The end of the paragraph is probably overset.

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
mircea_nicolae
Participant
November 3, 2014

Hi Ariel,

Thanks for your answer, you are actually correct, this is the case.

But do you know if there is any way to handle this case?

Try to catch this error without stopping the execution of the script?

How would I know which paragraph on this page is the one that is overflowing?

I see the Story item http://jongware.mit.edu/idcs6js/pc_Story.html

has an overflow property - should I assume the last paragraph is the one with the problem?

Thanks

TᴀW
Legend
November 3, 2014

you could check the last character of the paragraph. If its parent text

frame is undefined, it's overset. Something like this (myPara could

obviously be any variable)

myPara.characters[-1].parentTextFrames[0] == undefined

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators