Skip to main content
Participant
August 20, 2019
Answered

Add line break in textbox

  • August 20, 2019
  • 1 reply
  • 4406 views

Hi there,

i am quite new to scripting and I am looking for a way to add line breaks in the text in textboxes which are then transferred to the text layers in a comp.

So I created a UI with several textboxes in which the user can type in text. This text is then copied into the text layers in several comps. I would like the user to decide where he wants a line break. My idea would be if he types in specific characters then there is a line break.

For example if he types in: "First line +++ Second Line." The script then replaces the "+++" with a line break and the line break would be after "First line". Is this possible? Or is there another way to insert line breaks?

Thanks a lot for your help!

This topic has been closed for replies.
Correct answer migueld83371718

You can use multiline on the edittext creation properies:

var multiLineTextBox = container.add("edittext", undefined, "", {multiline: true})

1 reply

migueld83371718
migueld83371718Correct answer
Inspiring
August 20, 2019

You can use multiline on the edittext creation properies:

var multiLineTextBox = container.add("edittext", undefined, "", {multiline: true})

lohriAuthor
Participant
August 20, 2019

Cool, thanks a lot! That works. I didn't know about that one