Dialogue box needs focus
I've got script which pops up a dialogue box to ask the user the name of the file. The problem is I don't know how to add focus to the dialogue box, so as soon as you run the script and type the text goes into the field .
//dialogue time
var myDialog = new Window('dialog', 'File name to spew out');
myDialog.size = {width:300, height:90};
var myEditText = myDialog.add('edittext');
myEditText.preferredSize = {width:250, height:20};
var myNewName = myEditText.text;
var myGroup = myDialog.add('group');
myGroup.orientation = 'row';
var myOkButton = myGroup.add('button', undefined, 'isave', {name:'ok'});
var myCancelButton = myGroup.add('button', undefined, 'Cancel', {name:'cancel'});
if (myDialog.show() == 1) {
var docName = myEditText.text;
The original script was modified from here
Cheers