Hello,
I jumped into an additional issue.
I managed to get the modal window opening and passed the new variables definitions within the script for the input_table and the JMP_table name.
Going on the variable I see that it was correctly updated.
Then, the rest of my script is supposed to perform actions, such as opening the table specified by the user (outside of the button), but it does not run.
I tried putting the whole script into the modal window, I tried also adding a wait() but this does not help.
If I run the script without the modal window it works fine, so the issue definitely comes from there.
Any idea how to solve this?
Here is the code.
// Initialize variables with default values
// Number of input data tables (default = 1)
nb_join_tables = 2;
//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";
//Create a pop up window to request user inputs for the variables
w = New Window( "User inputs", <<modal, // opens a window with a title and this content...
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "From html to JMP data table" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "Number of tables you want to merge: " ), JMP_table_nb = Text Edit Box( nb_join_tables) ),
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "Insert here the .html link to the tables you want to import : " )),
Spacer Box( size( 1, 10) ), // a little vertical space
H List Box( Text Box( "input table 01: " ), input_table_teb01 = Text Edit Box( input_table_01) ),
H List Box( Text Box( "input table 02: " ), input_table_teb02 = Text Edit Box( input_table_02) ),
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
button = Button Box( "OK", // this script runs when the button is pressed...
w << closeWindow; // close the dialog
nb_join_tables = JMP_table_nb << Get Text;
input_table_01 = input_table_teb01 << Get Text;
input_table_02 = input_table_teb02 << Get Text;
)
)
)
)
);
// Name of the individual JMP data tables
JMP_table_01_name = "input01";
JMP_table_02_name = "input02";
// Create lists according to the number of tables to merge
tables_list = Eval List( {input_table_01,input_table_02} );
names_list= Eval List({JMP_table_01_name,JMP_table_01_name});
dt1={};
dt2={};
dt_list = Eval List({dt1,dt2});
For( i = 1, i <= nb_join_tables, i++,
show(i, tables_list); // check the log window for the output
//Open html data table from specific location
dt_list[i]=Open(
tables_list[i],
HTML Table( 4, Column Names( 0 ), Data Starts( 1 ) )
);
// Set JMP data table name to the desired one
dt_list[i] << Set Name( names_list[i] );
);