Hi @jthi and @hogi ,
Thanks for the information on where to start this process, it is very helpful. And, it's really only partly a solution right now.
I've been able to add a the menu script -- right now, I'm only adding two things: a local data filter and the save script (3 options): to data table, to scripting window and to Journal.
Right now, I have the local data filter and save script to Journal working just fine. What I'm having a harder time with is getting the save script to data table and save script to scripting window functionalities working. Below is the section of code where it activates the menu script and then assigns the action for each menu item selected.
mob << Set Menu Script(
{"Local Data Filter", ts << Local Data Filter ; gb << Local Data Filter, "Save Script", "", "To Data Table", nwin <<
Save Script to Data Table( "Correlation Analysis of " || ycols[1] || " vs. " || xcols[1], <<Promtp( 1 ), <<Replace( 0 ) ), "To Script Window",
nwin << Save Script to Script Window, "To Journal", mob<<Journal}
);
mob << Set Submenu( 2, 3 );
My customized report window looks something like this:
I'd like to have the option that the user could select the save script to data table (or scripting window) and it basically saves the script that is used to generate this customized report so that this analysis can be saved to the data table and someone can click the green script arrow next to the script and re-run the analysis without having to re-run the whole add-in.
From reading the about this in the scripting index, it appears that only objects like platform reports (e.g. Graph Builder or Time Series) can individually be saved to the data table, but the entire Outline Box object, which is my report window, doesn't accept that kind of send (<<) command. I'd prefer not to save each platform object individually, but rather the entire scripting code after I've used it to do the analysis to the data table/script window.
I'm not sure exactly why, but perhaps it's because my code is structure differently, because I'm using several Expr statements. As a rough idea, my code is structured as follows:
Names Default To Here( 1 );
//any variable definitions
var1 = .;
var2 = .;//etc
//Expression to recall roles
RecallRoles = Expr(
//inside is the code to recall roles
);
//Expression to clear roles
ClearRoles = Expr(
//similar code to clear roles
);
//User interface window
ValueDlg = Expr(
nwin = New Window(
// opens a new window with the main outline box and subpanels
//and action buttons
mob = Outline Box(
//this is the main outline box that contains the subpanels and
//time series and graph builder platforms
//it also contains the action buttons that perform certain tasks
)
);
mob << Set Menu Script(
//this is where I'm trying to save the evaluated script to the data
//table so a usercan just cick it, and the script will execute with
//the variables already evaluated and not have to cast columns into
//roles, etc.
);
);
ValueDlg;//this calls the ValueDlg Expr and evaluates it.
If either of you have any ideas or thoughts on how I could do this (which I hope my explanation makes sense), I appreciate any feedback on it.
Thanks!,
DS