Here's a function that will do exactly what mpb says (and it works):
CloseAllDataTablesExcept = Function({FunctionDataTable},
FunctionName = FunctionDataTable << Get Name;
For(i=NTable(), i>0, i--,
If(DataTable(i)<<GetName != FunctionName,
Close(DataTable(i), nosave)
)
);
);
Here's a function that will do exactly what mpb says (and it works):
CloseAllDataTablesExcept = Function({FunctionDataTable},
FunctionName = FunctionDataTable << Get Name;
For(i=NTable(), i>0, i--,
If(DataTable(i)<<GetName != FunctionName,
Close(DataTable(i), nosave)
)
);
);
DontClose = {"Test1", "Result"}; // Example names of tables you want to leave
// Loop backwards through the list, so the table numbers do not change
For( i = N Table(), i >= 0, i--,
If( Contains( DontClose, Data Table( i ) << get name ),
Continue(),
Close( Data Table( i ), "No Save" )
)
);
https://community.jmp.com/t5/Discussions/JSL-How-to-close-data-tables-after-analysis/m-p/36739#M2164...
Exact same question . Another way to script it . The post above also addresses this question