Hi All, I'm not new JMP, but relatively new to JSL. I'm trying to write a script to help automate some data analysis and output of said analysis.
I have a parent JSL script that I'm running that allows users to open files of interest for analysis and then perform a possible sequence of analyses, e.g. distributions, models fits, multivariate, bivariate fits, etc.
I am using a generic function in the script to ask the user to select from the current list of windows (data tables) on which to perform the analysis. The user would select a data table for performing, e.g. a multivariate analysis. I want to have this parent script also have a button script that offers them an option to then save a selected report (again calling the generic select window function). I am having a hard time taking the existing report window, e.g. multivariate analysis, and then sending that to a PDF. I have tried writing code to get the script from the report window and rerun that to send to a journal and save as a PDF, but this fails.
Below is my parent script:
Names Default To Here( 1 );
choose_data_table = Function( {},
list = {};
For( i = 1, i <= N Table(), i++,
list[i] = Data Table( i ) << get name
);
win = New Window( "Select a data table",
<<MODAL></MODAL>
Here is the script I'm using to try and extract the data to a jrn and save as pdf:
Names Default To Here( 1 );
wlist = Get Window List() << Get Window Title();
choose_window = Function( {},
win = New Window( "Select a Report",
<<MODAL></MODAL>
And here's the error I get:
Send Expects Scriptable Object in access or evaluation of 'Send' , chosen[1] << /*###*/SaveAs() /*###*/
I've tried many ways to get around this, but somehow I can't seem to get the JSL script to exectute a function allowing the user to select the report window of choice and have that then saved as a PDF (or PNG, or JPG, etc. -- as desired by the user).
Worked great, @gzmorgan0. Thank you!
I did modify the scaling factor based on some discussion in this thread: https://community.jmp.com/t5/Discussions/Scaling-to-fit-to-page-width/td-p/33952
Now, it will adjust the size of the report to fit the page width as needed, which is really nice.
Thanks for the quick help!
Try this:
Names Default To Here( 1 );
wlist = Get Window List() << Get Window Title();
choose_window = Function( {},
win = New Window( "Select a Report",
<<MODAL></MODAL>