Skip to main content
dublove
Legend
September 11, 2025
Answered

How can text in staticTexts.add automatically wrap based on a specified width?

  • September 11, 2025
  • 1 reply
  • 123 views
staticTexts.add({ staticLabel: "Doesn't the text inside automatically wrap to new lines?" });

Doesn't the text inside automatically wrap to new lines? Setting the width doesn't seem to work either.
I think I've seen people use jion(\n) to control line breaks.

 

Correct answer rob day

Adding `mutiline:true` directly to my original code didn't work.

 

That’s because the DialogRow or DialogColumn StaticText class does not have a mutiline property

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#StaticText.html#d1e593633

 

You probably can do it with the ScriptUI Classes—don’t confuse the ScriptUI Classes with the InDesign Dialog Class they are not the same. ScriptUI is here:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#WindowSUI.html

 

 

 

 

1 reply

Peter Kahrel
Community Expert
Community Expert
September 11, 2025

Several times people have pointed out to you that you should use the multiLine property.

See https://creativepro.com/files/kahrel/indesign/scriptui.html for details and examples.

dublove
dubloveAuthor
Legend
September 11, 2025

Thank you.

Adding `mutiline:true` directly to my original code didn't work.
It seems I need to rebuild the dialog from scratch.
I'll look into it later.

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
September 11, 2025

Adding `mutiline:true` directly to my original code didn't work.

 

That’s because the DialogRow or DialogColumn StaticText class does not have a mutiline property

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#StaticText.html#d1e593633

 

You probably can do it with the ScriptUI Classes—don’t confuse the ScriptUI Classes with the InDesign Dialog Class they are not the same. ScriptUI is here:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#WindowSUI.html