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

While loop is always true

Engaged ,
Apr 04, 2017 Apr 04, 2017

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);

TOPICS
Scripting

Views

603

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 , Apr 05, 2017 Apr 05, 2017

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

Votes

Translate

Translate
Guide ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Why the last line of script is outside of while loop?

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
Guru ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Maybe you also need to adjust the height?

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
Community Expert ,
Apr 04, 2017 Apr 04, 2017

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

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
People's Champ ,
Apr 05, 2017 Apr 05, 2017

Copy link to clipboard

Copied

recompose() ?

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
Community Expert ,
Apr 05, 2017 Apr 05, 2017

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

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
Community Expert ,
Apr 05, 2017 Apr 05, 2017

Copy link to clipboard

Copied

LATEST

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

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