Answered
How to automatically copy the content in the input box above after clicking the "Copy" button?
Hello everyone.
I want to click 'Copy' to automatically copy the content in the input box and prompt 'Copy successful'.
After the prompt pops up, click OK and the first two dialog boxes will automatically close at the same time.
Can you help me take a look?
Thank you.

// Create a new window
var win = new Window("dialog", "Name Input Dialog");
// Group for Name input
var inputGroup = win.add("group");
inputGroup.add("statictext", undefined, "YourName:");
var keyInput = inputGroup.add("edittext", undefined, "ROSE LU");
keyInput.characters = 10;
// Buttons group
var btnGroup = win.add("group");
btnGroup.alignment = "right";
var okBtn = btnGroup.add("button", undefined, "Copy"); // OK
var cancelBtn = btnGroup.add("button", undefined, "Cancel"); // Cancel
// Show the dialog
win.center();
win.show();
