"Return" will not be captured with Script UI
Thsi Script exports PDF files to a given folder without saving the current AI-file.
When one of the dialoge windows is open, I can navigate through the options and choose them with space-key. So the button gets blue higlighted but the predefined keeps its white outline. But hitting "Return" an the blue colored button, will not work at all. It will activate the white outlined button.
Space will activate the blue higlighted instead, like one would expect it from "Retrun", too.
Any idea how to capture "Return" when choosing e.g. "Abbrechen" in this dialogue?
function askDocumentChoice() {
var dlg = new Window("dialog", "Welche Dokumente speichern?");
dlg.add("Group {orientation:'row', alignment:['fill','top']}").add("statictext", undefined, "Sollen alle geöffneten Dokumente gespeichert werden?");
dlg.add("Group {orientation:'row', alignment:['fill','top']}").add("statictext", undefined, "(oder nur das aktuelle?)");
var buttonRow = dlg.add("Group {orientation:'row', alignment:['right','top']}");
var btnCurrent = buttonRow.add("button", undefined, "Nur aktuelles");
var btnAll = buttonRow.add("button", undefined, "Alle", { name: 'ok' });
var btnCancel = buttonRow.add("button", undefined, "Abbrechen", { name: 'cancel' });
btnCurrent.onClick = function() { dlg.close(0); };
btnAll.onClick = function() { dlg.close(1); };
btnCancel.onClick = function() { dlg.close(-1); };
dlg.defaultElement = btnAll;
dlg.cancelElement = btnCancel;
dlg.center();
return dlg;
}