Skip to main content
Inspiring
August 6, 2010
Answered

Dialogue box needs focus

  • August 6, 2010
  • 1 reply
  • 503 views

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

This topic has been closed for replies.
Correct answer Paul Riggott

myEditText.active=true;

1 reply

Paul Riggott
Paul RiggottCorrect answer
Inspiring
August 6, 2010

myEditText.active=true;

GhoulfoolAuthor
Inspiring
August 6, 2010

Thank you Paul.