-
1. Re: [JS CS4] How to allow "returns" in multiline edittext in scriptui
Marc Autret Aug 13, 2010 4:51 AM (in response to Skempy)AFAIK, within a multine EditText the Return key only works on Mac platform.
On Win platforms the user can press Ctrl+Enter to insert a new line.
Then, in order to parse the resulting lines in an array you could probably do this:
var lines = w.myText.text. replace("/[\r\n]+/g","\n"). split("\n");@+
Marc
-
2. Re: [JS CS4] How to allow "returns" in multiline edittext in scriptui
pkahrel Aug 13, 2010 4:58 AM (in response to Skempy)This is a problem. On Windows, try Shift+Num Enter, on the Mac, try Enter instead of Return (or possibly the other way around). If that doesn't work, add a button in the dialog that places an Enter, though that, too, is not entirely unproblematic on CS4. In CS3 it works fine, in CS5 too, but CS4 is a bit tricky. Harbs has a script somewhere where he uses a button to insert a return character (see his site), and I did something similar here: http://www.kahrel.plus.com/indesign/grep_editor.html; there's also a description of the problem there.
Peter
Ah -- Ctrl+Enter, as Marcwrites; had forgotten about that.
-
3. Re: [JS CS4] How to allow "returns" in multiline edittext in scriptui
Skempy Aug 13, 2010 5:09 AM (in response to Marc Autret)Thanks Marc (and Peter). This enough for me to continue.
The script I am attempting to write is purely for a few internal users so explaining that they will have to use the Ctrl+Enter combination will not be an issue.
Thanks.
-
4. Re: [JS CS4] How to allow "returns" in multiline edittext in scriptui
brettpolo Aug 13, 2010 6:15 AM (in response to Skempy)With the mulitline edittext in ScriptUI,the return key is captured and passed on as a edittext onChange. You can capture this onChange, and use it to add a new line to the edittext text field like so:
w.myText.onChange = function(){w.myText.textselection = "\n"}This doesn't work perfectly*, but should give you the functionality you need.
/dan
*it will only add the new line if changes have been made to the edittext field since the last time the edittext was focused on.



