Skip to main content
dublove
Legend
Sep 11, 2025 8:09 AM UTC
Answered

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

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.

 

rob day
rob dayCorrect answer
Community Expert
Sep 11, 2025 5:10 PM UTC

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

 

 

 

 

3 replies

Peter Kahrel
Community Expert
Community Expert
Sep 11, 2025 1:41 PM UTC

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.

Translate
dublove
dubloveAuthor
Legend
Sep 11, 2025 4:07 PM UTC

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.

Translate
rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
Sep 11, 2025 5:10 PM UTC

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

 

 

 

 

Translate