cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Craige_Hales
Super User
JMP's Recent File List (Windows)

This example uses Run Program to read the windows registry to get the files in JMP's recent file list.

temp=runprogram(executable("reg"),options({"query","\["HKCU\Software\SAS Institute Inc.\JMP\Recent\Files"]\"}),readfunction("text"));
names = {};
// typical line: "    File7    REG_SZ    C:\Users\v1\Desktop\Nanami01.jrn"
patmatch(temp,patrepeat(patregex("\s+File\d+\s+REG_SZ\s+")+patbreak("\!n\!r")>>path+pattest(insertinto(names,path);1)));
show(names,nitems(names))

names = {"F:\FileSnapper\Additional.jsl", "F:\FileSnapper\makeAddin.jsl", "F:\rectangula\virusmap3.jsl", "F:\rectangula\virusmap2.jsl", "F:\turtle\drawing.jmpprj", "F:\AVI\video.jmpprj", "C:\Users\v1\Desktop\Nanami01.jrn", "F:\chess\chessPlay.jsl", ...

 

The patmatch function skips over leading, non-matching text, then adds files to names as long as the pattern repeats. If the registry contained some other values (I don't know why it would) you might have to make the pattern more sophisticated to skip unknown keys and continue.

 

Running the reg query command in a command window looks like this

Capture1.PNG

readfunction("text") returns that same text to the temp variable.

 

Last Modified: May 9, 2020 9:08 AM
Comments