2 people found this helpful
You can't tell right away if a textframe is filled all the way to the bottom. Even with linked text threads, there is usually a small space at the bottom, just not enough for an entire next line -- less than the leading of that next line. There may even be more space at the bottom, if the next frame starts with a heading, which is kept with a number of lines following it; or a large inline table or figure; or a hard page break. Or (come to think of it) a footnote -- I'm not sure what would happen then ...
But you can get the vertical position of the last regular text line. With a text frame selected:
will show you the absolute vertical position of that last line. If you need the distance from the top of its containing text frame, use
alert (app.selection.lines.item(-1).baseline - app.selection.geometricBounds);
-- you might remember that the array 'geometricBounds' contains the positions of top, left, bottom, and right corners, in that order. So geometricBounds is the top y position; subtract this from your baseline, and you know how low you go.
In this case, you would want the distance from the last line to the bottom:
alert (app.selection.geometricBounds - app.selection.lines.item(-1).baseline) ;wwill show you how much space there is left. A warning is in place: blank lines are also lines! (Theoretically, if this happens a lot, you could adjust for these. Left as an exercise.)All you have to do is ask yourself, what amount of white space at the bottom is allowed? Then check your frames for this, and only apply vertical justification if it's inside your parameters.(Apologies for those weirdly cramped final paragraphs. Sorry -- tried to restore it to normal readability, failed miserably. Jive Strikes Again!)
A lot thanks...
I will work in this way...