Why is this not working?
...
var newFolder = inputGroup.add ("group");
var newIFolder = newFolder.add("edittext",[0, 0, 300, 20]);
var addButton = newFolder.add ("button", undefined, "Add");
var closeButton = window.add ("button", undefined, "Close");
closeButton.onClick = function() {
window.close();}
addButton.onClick = function() {
return newIFolder.text;
window.close();
alert(newFolder.text);}
...
Nothing happens onClick, the window just remains open.
Perhaps it’s because of the groupings, somehow. I’ll try to move it on top level, while I wait.
Thanks in advance and best regards.
Edit: On top level no change 🙁
Edit2: I’ve tried, but no change 🙁
var addButton = window.add ("button", undefined, "Add", {name: "ok"});
2
Answers
Final solution ended like this:
Once again, Thank you very much :D
Here is exactly the code I just tried and it works fine for me (InDesign 2022, Illustrator 2023, Photoshop 2023):