Copy link to clipboard
Copied
Hi guys,
I'm trying to get a text frame to expand while the text is overset.
I've tried the following but nothing works:
while ( watermark.overflows === true ) {
watermark.geometricBounds[3] = watermark.geometricBounds[3] + 10;
}}
// also tried
watermark.fit(FitOptions.TEXT_TO_FRAME);
The problem is that you just change the geometricBounds: you should also apply the changed bounds:
gb = watermark.geometricBounds;
while ( watermark.overflows === true ) {
gb[3] += 10
watermark.geometricBounds = gb;
}
Peter
Copy link to clipboard
Copied
Why the last line of script is outside of while loop?
Copy link to clipboard
Copied
Maybe you also need to adjust the height?
Copy link to clipboard
Copied
Hi Jake,
search the Adobe InDesign Scripting forum for "overflows".
It's likely there is an answer and perhaps a solution.
What we cannot know:
What formatted contents is held by watermark?
Is hyphenation turned on? How are the keep settings? Is noBreak set to true for all the text?
How are the insets of the frame? Is text wrap applied to a different object influencing the text frame's ability to hold text?
Etc.pp. …
You see, there could be good reasons, that you are stuck with a permanent overflow.
Did you try your algorithm on a simple text frame with no other objects on the spread?
Regards,
Uwe
Copy link to clipboard
Copied
recompose() ?
Copy link to clipboard
Copied
Loic.Aigon wrote
recompose() ?
Hi Loic,
will help sometimes, sometimes not.
There are a lot of discussions here in the forum about the usability of recompose():
Re: change paragraph style point size for overset text
Re: Updating a document's layout
Regards,
Uwe
Copy link to clipboard
Copied
The problem is that you just change the geometricBounds: you should also apply the changed bounds:
gb = watermark.geometricBounds;
while ( watermark.overflows === true ) {
gb[3] += 10
watermark.geometricBounds = gb;
}
Peter