Subscribe Bookmark RSS Feed

Identifying all visible windows in JMP 9

Is there a way to determine in JMP 9 the names of all the currently open windows, and also whether each one is visible or invisible? This information is effectively contained within the Window List, but I'd like to access it via a script.  The reason I'm asking is that on a couple of laptops here, whenever the user tries to open another application (for example to read an email that's just arrived), all the visible JMP windows are instantly minimized - forcing him to restore them all again afterwards. I'd like either to determine what it is that's doing this - and stop it if possible - or alternatively write a little function that will restore all minimized but visible windows with a single button click.

Many thanks

3 REPLIES

Postscript: Since posting the above I've discovered the "window()" function, so I can now find out how many windows there are, but I still can't see how I can determine their names, or whether or not they're invisible - unless I can get that from their sizes, which I do seem to be able to access.

Postscript to the postscript: almost there; just the visibility problem to solve now:

ww = window();

show(ww);

for(i=1, i<=nItems(ww), i++, show(ww[i] << get window title));

ms

Super User

Joined:

Jun 23, 2011

I do not have a solution to the original problem of windows beeing minimized. Can it be a setting in Windows? On the Mac I never seen anything like that.

However it seems you can get visibility from their size as you suggest (or position).

An example:

dt = New Table( "test1", invisible );

dt = New Table( "test2" );

dt = New Table( "test3", invisible );

dt = New Table( "test4" );

ww = Window();

vw = {Visible, Invisible};

For( i = 1, i <= N Items( ww ), i++,

          print( evallist({ww[i] << get window title, vw[Is List( ww[i] << get window size ) + 1]}) )

);

I think I may have misinterpreted the window minimization problem: I've just been re-examining the screenshots I’ve been sent, and it looks as though it's actually related to a program crash in some way - so I just need to debug the script and the problem will go away.  In the meantime however, I've also been experimenting: it looks as though it's the window position, as opposed to the size, that's the giveaway when it comes to determining visibility:

// Start of program;

Clear Log();

wa = New Window( "wa - Alpha", Text Box( "This is Alpha" ) );

wb = New Window( "wb - Beta", Text Box( "This is Beta" ) );

wc = New Window( "wc - Gamma", Text Box( "This is Gamma" ) );

wd = New Window( "wd - Delta", Text Box( "This is Delta" ) );

// List all the properties of one of them for reference;

Show Properties( wa );

// Hide Beta and Delta;

wb << show window( 0 );

wd << show window( 0 );

// Position Alpha and Gamme exactly at (500, 500), and then minimize Alpha;

wa << move window( 500, 500 );

wc << move window( 500, 500 );

wa << minimize window;

// wa << minimize window(0); // To restore it again, uncomment this line;

// Now try to work out where they all are;

ww = Window();

wintitle = {};

height = {};

width = {};

xpos = {};

ypos = {};

Visible = {};

For( i = 1, i <= N Items( ww ), i++,

       Insert Into( wintitle, (ww[i] << get window title) );

       Insert Into( width, (ww[i] << get size)[1] );

       Insert Into( height, (ww[i] << get size)[2] );

       Insert Into( xpos, (ww[i] << get window position)[1] );

       Insert Into( ypos, (ww[i] << get window position)[2] );

       Insert Into( Visible, If( (ww[i] << get window position)[1] < 0, "No", "Yes" ) );

);

WindowTable = Table Box(

       String Col Box( "Window Title", wintitle ),

       Number Col Box( "Width", width, set format( 6, 0 ) ),

       Number Col Box( "Height", height, set format( 6, 0 ) ),

       Number Col Box( "Xpos", xpos, set format( 12, 0 ) ),

       Number Col Box( "Ypos", ypos, set format( 12, 0 ) ),

       String Col Box( "Visible?", Visible )

);

WindowTable << table style( "Embossed" );

windowcontrol = New Window( "Window Summary", WindowTable, );

// End of program;

I can't see any means of determining whether a window's been minimized or not, as the size and position don't seem to change, but really that's a detail: I've now modified my scripts so that any window I don't want the user to see has simply been made invisible.

Many thanks for your help!