Hello @nikles,
This doesn't directly answer your question but I suggest avoiding references to tables by name. The most common issue I see is someone already having a table open with the name you are interested in, or a future change to your script having unintended consequences. Instead, you can save a reference to that table and use that in the rest of your script. If you are counting on the user already having a specific table open, you can search for it. Here are some examples:
Names default to here(1);
dt1 = Open( "$Sample_data/iris.jmp" );
dt1 << Set Name("iris2");
dt1 = Open( "$Sample_data/iris.jmp" );
dt2 = Open( "$Sample_data/big class.jmp" );
//Get first matching table
dt3 = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"))[1]
//or ask the user which one to use
TableList = filter each({dt}, Get data table list(), Contains(dt << get Name,"iris"));
winSelectTable = New Window("Which Table?", << Modal, << Return Result,
lbTable = List Box(TableList)
);
dt3 = filter each({dt}, Get data table list(), (dt << get Name) == winSelectTable["lbTable"][1])[1];
//Now always refer to that table using the table reference
dt3 << Distribution( Continuous Distribution( Column( :Sepal length ) ) );
//If making new tables in your script, you can usually get those references
//from the functions that create them:
dt4 = (dt3 << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :Sepal length ) ),
Row Table( Grouping Columns( :Species ) )
)
)) << Make Into Data Table;
dt4 << Get Name()'
n, you can search for it first and then use a reference after that.