Data table screen size set by JSL script is not always saved with .jmp fileI find that, when I set the window size of a data table with JSL, then save it out, there's at least one mode where the window size settings don't seem to have been saved with the .jmp file. Instead, it seems that the window size settings from the last manually saved settings, (i.e., via the UI), are used for (or saved with) the .jmp file. The following code is made up of snippets from my JSL script, so has not been tested by itself, but is representative:
dt = Current Data Table();
window = Get Window( dt );
window << Set Window Size( 1300, 700 );<BR />dt << <SPAN>Save</SPAN>( <SPAN>"myTable</SPAN><SPAN>.jmp"</SPAN> );
dt << Close Window;
I have also tried using Set Content Size() instead of Set Window Size(), and it seems to behave the same way. (It's not clear to me from the docs which is more appropriate for this purpose; perhaps someone could comment on the specific difference between the two.)
I am experiencing this behavior running JMP 14.2 under Windows 7. However, I notice that, with Mac OS (running 14.3), I'm not able to reproduce the issue, and the JMP table window sizes always get saved as expected by the JSL script. This makes me wonder whether there might be any User Preferences settings that are overriding the script's parameters. (I've encountered this before with Open().)
The only other discussion I could find on this subject generally was screen size, but it does not seem to be directly relevant.
Re: Data table screen size set by JSL script is not always saved with .jmp fileHey Hadley, Craige, and JMP Community– I believe I've tracked the issue down to a bug in my code. I had originally noted that I had also tried using Set Content Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN> instead of Set Window Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN>. But, in fact, my original code on both the Mac and Windows sides were using Set Content Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN>, and I had only recently transitioned the Mac code over to using Set Window Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN> — (probably as part of my effort to debug this issue). But now, after also applying Set Window Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN> to the Windows code, I find that the window size is persistent and always as expected when the file is opened. Likely, the reason I didn't make this connection sooner was that Set Content Size<SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN> seemingly works just as well for this purpose in a Mac environment, and that's where I do most of my development.
Re: Data table screen size set by JSL script is not always saved with .jmp fileJMP keeps a list of recent window positions/sizes (in the Windows registry, separate from the size in the table) so it can reopen scripts and tables in the same location and size as before. They compete with whatever the table knows about its preferred size. @jschroedl
Re: Data table screen size set by JSL script is not always saved with .jmp fileHi Hadley– that's a very clever workaround! I wasn't aware that JMP will automatically run a script named 'OnOpen' if it finds it upon opening a data table file. It's a very nice feature, and I'm starting to think of other, unrelated applications of its use!
Before I accept this as a solution, I'd like to find out if this is a known issue with JMP 14 running on Windows, and, if so, has it been addressed in JMP 15 or planned for JMP 16. If you or one of your colleagues could find that out, that would be very helpful.
Re: Data table screen size set by JSL script is not always saved with .jmp fileHi,
I believe this is a Windows issue, but here is a workaround:
dt = Current Data Table();
dt << New Script(
"OnOpen", // create the script
window = Get Window( Current Data Table() );
window << Set Window Size( 1300, 700 );
);
dt << Save( "myTable.jmp" );
dt << Close Window;
Please try this and let me know if it works for you.