The
dt << run scripts( filename );
will run the script after it has been saved to the data table.
dt = Current Data Table();
dir = "C:\work";
fileNames = Files In Directory( dir );
if (dir!="",
For( iFile = 1, iFile <= N Items( fileNames ), iFile++,
filename = fileNames[iFile];
show(filename);
If( Ends With( filename, ".jsl" ),
file_path = dir || "\" || filename;
show(file_path);
x = Load Text File( file_path );
Eval( Parse( "dt << new script(filename," || x || ")" ) );
dt << run scripts( filename );
);
);
);
If you want all of the scripts run whenever the data table is opened, you can add a table script called OnOpen where you could specify to run each of the table scripts.
Jim