JSL script Open latest version file in the folderHi,
I want to automate the script where it will automatically open the latest file based on latest date in the file name and latest modified date in a specific folder which shown in the picture below. How can I do this?

Re: JSL script Open latest version file in the folderMany thanks Jim - I overlooked 'Last Modifcation Date()', so it's good to know about it . . .
Re: JSL script Open latest version file in the folderYou can use
Files in Directory()
to get all of the files in a directory.
And then using Ian's code, you can loop across all of the files and get the file with the latest date in it's name,
and/or, you can use the
Last Modification Date()
function to find the last time each specific file was modified
Names Default To Here( 1 );
Format(
Last Modification Date(
"$SAMPLE_DATA/Big Class.jmp"
),
"ddmonyyyy:h:m:s"
);
Re: JSL script Open latest version file in the folderThe File - Import Multiple file command can add a column or filter based on the last modified date. You could point it at the folder, read in all the data and then just keep the file with the newest date.
Multiple File Import(
<<SET folder=""></SET>
Re: JSL script Open latest version file in the folderLooks like there are two requirements here - To get the file creation date (encoded in the file name), and to get the last time this file was modified (from the operating system).
For the first of these, you could try starting from the JSL below:
NamesDefaultToHere(1);
// Given a file name constructed in a particular way, returns the encoded creation date
getDateFromFileName =
Function({fName}, {Default Local},
pieces = Words(fName, "-");
pieces[1] = Substr(pieces[1], 8, 2); // Get the 'day'
pieces[3] = Substr(pieces[3], 1, 4); // Get the 'year'
dt = Num(Informat(pieces[1]||pieces[2]||pieces[3], "DDMonYYY")); // Get the JMP datetime from the pieces
);
fName = "Testing01-Nov-2018_.xlsx";
dt = getDateFromFileName(fName);
Note that how robust this kind of code is will depend crucially on what you can (and can't) safely assume about how the file name is constructed.
To get the last time a file was modified, you may need to look at 'Run Program' (search for this in 'Help > Scripting Index').