[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:
- run script , display dialog (as i'd expect).
- in dialog click button display second dialog (as i'd expect).
- click ok (or cancel) in second dialog.
- 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
Post a Comment