Working with Line Breaks in Text Widgets

You can force line breaks while using the applyText() API of the text widget.

The line breaks you've set will be kept if you use the API getPlainText().

Usage

In the script editor, you can use \n as control character to force a line break in a text widget via the widget's API applyText().

Example
Let's assume you use a button and a text widget in your application. When the user clicks on the button at runtime, a new text line is displayed in the text widget, saying This is a new paragraph.. To achieve this, type in the following script in the button's onClick event:
Sample Code
var currentText = Text_1.getPlainText();
Text_1.applyText(currentText + "\nThis is a new paragraph.");

This line of script will change the text widget's content.

Before:

After: