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

While loop is always true

Engaged ,
Apr 04, 2017 Apr 04, 2017

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
865
Translate
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

Translate
Guide ,
Apr 04, 2017 Apr 04, 2017

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

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

Maybe you also need to adjust the height?

Translate
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

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

Translate
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

recompose() ?

Translate
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

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

Translate
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
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

Translate
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