Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[ScriptUI] How can I have actual multiline EditText in my scritpt for note taking purpose?

Contributor ,
Feb 22, 2020 Feb 22, 2020

I've added a multiline edittext in my scriptUI by enabling {multiline : true} it does introduce multi line edittext. But I can't able to use Enter button to introduce new line as I typing in the edittext area. So how can I have a edittext that takes multi line input from user intraction instead of Warping single line to multiple line?

TOPICS
How to , Scripting , User interface or workspaces
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Feb 23, 2020 Feb 23, 2020

Enter key seems to work just fine in this snippet.

Any chance you have any eventListener's in your panel, that listens for Enter key and therefore blocks the default editText behavior?

(function(thisObj) {
	var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'script', undefined, {
		resizeable: true
	});
	win.alignChildren = ['fill', 'fill'];
	win.preferredSize = [400, 300];

	var et = win.add('edittext', undefined, undefined, {
		multiline: true,
	});
	
	win.onResizing = win.
...
Translate
Advocate ,
Feb 23, 2020 Feb 23, 2020

Enter key seems to work just fine in this snippet.

Any chance you have any eventListener's in your panel, that listens for Enter key and therefore blocks the default editText behavior?

(function(thisObj) {
	var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'script', undefined, {
		resizeable: true
	});
	win.alignChildren = ['fill', 'fill'];
	win.preferredSize = [400, 300];

	var et = win.add('edittext', undefined, undefined, {
		multiline: true,
	});
	
	win.onResizing = win.onResize = function() {
		this.layout.resize();
	};

	win.show();
})();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 23, 2020 Feb 23, 2020

Sorry it was my fault. I was trying to run the script in ExtendScript Toolkit itself. That's where the problem occurs. Eventhough I don't see any eventListerners for Enter key. It doesn't have the ability to create a new line when I run the script in ExtendScript Toolkit. And Thank you so much for giving me a new direction that eventListerners could block the behaviour of an element. BTW can you tell me why is it not working in ESToolkit?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 23, 2020 Feb 23, 2020
LATEST

No idea. Honestly, in my 8-year-old scripting career, I used ExtendScript Toolkit app maybe like 2 or 3 times.

Also, ESToolkit is dead, you should switch to VSCode + this https://marketplace.visualstudio.com/items?itemName=Adobe.extendscript-debug as soon as possible.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines