Answered
How to control ScriptUI editText ScrollBar
w = new Window('dialog', 'multiline');
w.alignChildren = 'left';
var group1 = w.add("group", undefined, { name: "group1" });
group1.orientation = "column";
var editText = group1.add("editText", undefined, undefined, { multiline: true, scrolling: true, readonly: true});
editText.preferredSize.height = 500;
editText.preferredSize.width = 500;
editText.text = "123";
var addTextButton = w.add('button', undefined, 'addText');
addTextButton.onClick = function addTextButton_onClick() {
editText.text = editText.text.concat("\riiiii");
}
w.show();
I have a long editText, and everytime when I update text, the scrollbar will move to the top, but I want it to stay at the buttom. Is there any way to control scrollbar's value of editText? Thanks