In a script, return the selected table scripts as a listHi, I am aware of using the code below to return all the table scripts
scriptNames = dt << Get Table Script Names;
Is there a way to only return the scripts that I have selected (if any are selected, otherwise return all).
So return [Bivariate,Logistic] in the case below

ScriptingRe: In a script, return the selected table scripts as a listThis illustrates how to get the script:
dt = open("$SAMPLE_DATA/Big Class.jmp");
scriptNames = dt << get table script names;
// as an example, get the first script
scriptName = scriptNames[1];
script = dt << get table variable(scriptName);
The script comes back as a string. You can use parse to convert it to executable JSL.
To work with selected scripts try the GetSelectedProperties message.
Re: In a script, return the selected table scripts as a list<< Get Selected Properties seems to do the trick dt<)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Select Properties({2, 4});
proplist = dt << Get Selected Properties();Re: In a script, return the selected table scripts as a listTo clarify, the selected scripts are variable. So an answer with hard coded script indices is not what I'm looking for.
In other words, I want to first determine WHICH scripts I have selected and then return those.
Re: In a script, return the selected table scripts as a listThere are no hard-coded indices. Selection of properties is there for demonstration purposes, but maybe this is more suited for you (it will return Empty() as nothing is selected):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
proplist = dt << Get Selected Properties();
<< Get Selected Properties won't directly return you with the names of the scripts but you can fairly easily get the names from what it returns by using Arg() for example.
Re: In a script, return the selected table scripts as a listThe information is contained in the results from get selected properties, but you might have to do some work to unpick the information. Here is an example:
// example from the scripting guide
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Properties( {2, 4} );
proplist = dt << Get Selected Properties();
// number of selected scripts
numSelectedScripts = nitems(proplist);
// pattern for picking out the script name
pat = "\!"en\!" => \!"" + PatArb()>>strScriptName + "\!"";
// build list of script names based on selection
lstScriptNames = {};
for (i=1,i<=numSelectedScripts,i++,
strScriptName = char(proplist[i]);
success = PatMatch(strScriptName,pat);
if (success,
insertinto(lstScriptNames,strScriptName)
)
);
show(lstScriptNames);Re: In a script, return the selected table scripts as a listThat is perfect! Thanks for the detailed solution
Re: In a script, return the selected table scripts as a listI see now that in my own datatables the specific extraction you're using to get the English script name is not working. I do not have the multi-language structure that I see in the big class datatable. Is this something that changed recently, or possibly some language setting within JMP that causes it to be different between systems?
I've changed your pat variable to be like this to make it work for me.
pat = "\!"" + Pat Arb() >> strScriptName + "\!"";
Re: In a script, return the selected table scripts as a listThe localized sample tables are created by the JMP localization team. Tables you create will not have L10N data. Your solution is fine for non-sample data tables (any table you create.)
Keeping only one copy of each sample table makes shipping a new version of JMP every 18 months easier. During the JMP 4 era the sample tables were cloned and translated, and then updated tables had to be re-translated for JMP 5. What a nightmare!