Hi All, does anyone know why auto-running a JSL script cannot detect an already open JMP window? This is bizarre to me as I'd expect the behavior of auto-running or manually running a JSL script to be the same (but it does not appear to be so). Any thoughts or tricks to get around this? thanks, DJ
Weirdness noted - prior to running the JSL below a JMP window with title "My Open Window" is already open.
Case 1. Auto-Run (//!): it DOES NOT detect the JSL window already open (incorrect). In this case the Log shows an empty list for the window title.
//!
for(i=1,i<=nitems(window()),i++,
if(contains(window(i)<<get window title,"My Open Window")!=0,
write("Open Window Detected: " || char(window(i)<<get window title))
)
);
Case 2. No Auto-Run (i.e. manually running the JSL script in the JMP script window): it DOES detect the specific JSL window already open (correct). In this case the Log does show the "My Open Window" for the window title.
////!
for(i=1,i<=nitems(window()),i++,
if(contains(window(i)<<get window title,"My Open Window")!=0,
write("Open Window Detected: " || char(window(i)<<get window title))
)
);