Hi all,
I am try to create a script that would go through directories to find the input file. However, some file names may have different characters.
For example:
My input in favorite fruit would be: Orange
Existing files from folder would be: Mark_Orange_Mango.jmp, Jane_Apple.jmp, John_Orange.jmp
Files that would open: Mark_Orange_Mango.jmp and John_Orange.jmp
How can I open these files using contains() or what function do I need to use? I am using JMP 15
Here is the piece of code I am working on:
nw = New Window( "Favorite Fruits", << modal(),
lineupbox(ncol(2), spacing(5),
Text Box( "Name:" ),
teb1 = Text Edit Box( "", <<set width( 150 ) ),
Text Box( "Age:" ),
teb2 = Text Edit Box( "", <<set width( 150 ) ),
Text Box( "Birthday:" ),
teb3 = Text Edit Box( "", <<set width( 150 ) ),
Text Box( "Favorite Fruit:" ),
teb4 = Text Edit Box( "", <<set width( 150 ) ),
),
Button Box( "OK",
name = teb1 << get text ();
age = teb2 << get text ();
bday = teb3 << get text ();
fruit = teb4 << get text ();
),
);
/* ----- opening the files ----- */
path = "C:\Users\Desktop" || Char (name) || "\" || Char (bday);
files = Files in Directory (path);
For (j=1, j<= N Items (files), j++,
If (Contains (fruit[j], ".jmp"), // Open file that contains the input from text box
...
)
);