[JS] Script UI Second Window Problem


the code below seems work @ first, @ closer there's problem (and can't figure out how fix it). here's what's happening:

 

  1. run script , display dialog (as i'd expect).
  2. in dialog click button display second dialog (as i'd expect).
  3. click ok (or cancel) in second dialog.
  4. now you're in main dailog, once again click button display second dialog. time second dialog display collapsed , can't see inside it. displays right "first" time, not "second" time.

 

any thoughts? in advance,

dan

 

#targetengine 'session'  var mywin = new window("dialog", 'window 1' );           sometext = mywin.add( "edittext", undefined, 'some text here' );           var clickmebutton = mywin.add( "button", undefined, 'click me open window' );           var okbutton = mywin.add( "button", undefined, 'ok' );           var cancelbutton = mywin.add( "button", undefined, 'cancel' );  var mysecondwin = new window("dialog", 'window 2' );           sometext2 = mysecondwin.add( "edittext", undefined, 'some text here2' );           var okbutton2 = mysecondwin.add( "button", undefined, 'ok' );           var cancelbutton2 = mysecondwin.add( "button", undefined, 'cancel' );  clickmebutton.onclick = function() {           mysecondwin.center();           mysecondwin.show(); }  mywin.center(); mywin.show();  

one way....

 

#targetengine 'session'  var mywin = new window("dialog", 'window 1' );           sometext = mywin.add( "edittext", undefined, 'some text here' );           var clickmebutton = mywin.add( "button", undefined, 'click me open window' );           var okbutton = mywin.add( "button", undefined, 'ok' );           var cancelbutton = mywin.add( "button", undefined, 'cancel' );  clickmebutton.onclick = function() {                     var mysecondwin = new window("dialog", 'window 2' );                     sometext2 = mysecondwin.add( "edittext", undefined, 'some text here2' );                     var okbutton2 = mysecondwin.add( "button", undefined, 'ok' );                     var cancelbutton2 = mysecondwin.add( "button", undefined, 'cancel' );            mysecondwin.center();           mysecondwin.show(); }  mywin.center(); mywin.show(); 


More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support