Issue with Script UI Dialog button clicks causing previous application to load
Hi all - encountering a weird bug with a client. They are running Windows 10, and trying to execute a script that executes a variety of different dialogs. I'm using onClicks for the buttons. When they either use keystrokes or mouseclicks on the buttons, the script brings up the previously used application (ie, it makes Chrome the active application). I'm running these scripts on Mac Catalina, and not having this issue, nor did they have this issue running on InDesign CS6. It's only in their Windows 10 instance that's this happening. Has anyone experienced this before? Should I just use "1" and "2" results on the button clicks instead. Tough for me to test since I don't have Windows 10. Here's one sample dialog below.
Thanks.
var dialog = new Window("dialog");
dialog.orientation = "column";
dialog.alignChildren = ["center","top"];
dialog.spacing = 10;
dialog.margins = 16;
dialog.text = "Test";
var statictext1 = dialog.add("statictext", undefined, undefined, {name: "statictext1"});
statictext1.text = "Change cell contents to " + short_code + "?";
// GROUP1
// ======
var group1 = dialog.add("group", undefined, {name: "group1"});
group1.orientation = "row";
group1.alignChildren = ["left","center"];
group1.spacing = 10;
group1.margins = 0;
var button1 = group1.add("button", undefined, undefined, {name: "ok"});
button1.text = cell_contents.contents.toUpperCase();
button1.onClick = function() {
dialog.close();
}
var button2 = group1.add("button", undefined, undefined, {name: "cancel"});
button2.text = short_code;
button2.onClick = function() {
change_cell = true;
dialog.close();
}
dialog.show();
if (change_cell) {
the_cell.contents = short_code;
}
