Hi. Is there a way to have a script search the user's computer for a given filename and return the path? Im using a Mac and JMP14.3 atm. I'm interested in creating an add-in that calls another script on the user's computer, but I won't know where the user has stored the script.
In the add-in, I'm thinking something like this:
//Add-in code
path = [command or function to search for "myscript.jsl" on user's computer and return a path];
Include(path, New Context);
//Things I've explored:
//Not certain what the "search" option does, but seemed worth a go.
//This only returns my default directory with "myscript.jsl" appended
//(even though there is no such file in that location)
path = ConvertFilePath("myscript.jsl", search);
//There's also this, but same result as above:
Set File Search Path("$HOME/");
path = ConvertFilePath("myscript.jsl", search);
//As a last resort, I looked at this, thinking maybe if I could get a list of all files,
//I could then search the list for myscript.jsl. Unfortunately I cannot get the "recursive"
//option to work on my machine (Mac, JMP14.3). I imagine this would be a very slow method
//though as there are 1000s of files in a typical user's home directory.
y = Files In Directory("$HOME", "recursive"); //Returns {}
y = Files In Directory("$HOME", "Recursive"); //Returns {}
y = Files In Directory("$HOME", recursive); //Returns {}
y = Files In Directory("$HOME", Recursive); //Returns {}
y = Files In Directory("$HOME", Recursive(1)); //Returns {}
//All options above just return {}. I'm curious if this is unique to my setup (Mac, JMP14.3).
Other than that, I'm out of ideas. Does anyone have any suggestions? Thanks.