So here we're going to see how to use scripts to open JMP data tables. So I'll get a new Script Editor window and I'm going to use the pick directory function to prompt the user when the script runs to navigate to a directory or folder. And I'm going to store that result in the variable myPath. And here notice with the variable name, I'm using an example of what we call camel case where instead of using spaces between the two words in this variable name I simply capitalize the first letter of the second word to make that a little easier to read. So I'll assign the result of the pick directly function to myPath. So pick directory. And the prompt is optional. This will appear in the upper left corner of the browse for folder dialog but the prompt would be a character string if you use it. So I'll go ahead and do that and type "Where is the Cure Time file?" So that just helps the user know what I want them to be looking for. And I'll run the script. And this has actually taken me to the last folder that I navigated to interactively, which is the data for this course. So I could just go ahead and click Select Folder here but imagine if you had to actually navigate to that. You don't have to go into the folder. I could just select it rather than opening it and click Select Folder. This will have the same result as if I did open it and clicked Select Folder. And you can see then what's returned to the log and what's stored in my path is the character string with that path to that folder or directory and completed with the final forward slash. So what do we do once we've retrieved this path? Well, I'm going to go to a new line and I'm going to use that when I use the open function to open up the Cure Time data table. I'll store the results of this in the variable dt. So the open function is going to return a data table object reference in addition to opening that data table. So I'll say open, and then I just use the variable myPath and concatenate it with the two vertical bars or two vertical pipes concatenate that with the character string with the name of the data table which is Cure Time with a space between the words dot JMP. And I'm going to run just this line. And just a reminder that you can run a single line of a script that your cursor is on using the Enter key on the numeric keypad on the right hand side of a standard desktop keyboard. So I run just that line. It opens up the Cure Time data table. I see in the log that we have created an instance of a data table object when we have a reference to that which is then stored in dt. So if I come back to the script and hover over dt, you can see that that's storing that object reference for this data table. So we could send messages to the data table and otherwise interact with it. For our purposes, we're just focusing on using this open function. And one thing before we look at a few other examples is people sometimes think that because I've stored the object reference to the data table in dt that I don't have to have this data table open anymore, and that's not actually the case. If I come back to the Cure Time data table and close that, and I'll go to a new line and I'll just type dt on this line and run that one line to mimic trying to use the data table. When I run that, what's returned to the log is Data Table ("UnknownTable"). So just because I have an object reference for a data table stored in a variable, that doesn't mean I can close the data table. It's still going to be held in memory while I work with it. I'm going to clear the contents of lines and here. I'll actually leave the first line although I won't be running that again. I want to use the pick file function now. And I'll store the results of that in the variable f. So f will be assigned the result of pick file. And in parentheses, now there are two optional arguments to pick file. There's a prompt argument and a directory argument. And if I don't want to supply a prompt but I want to supply a directory, these are unnamed arguments so their position matters. And so I would have to just type a comma in the parentheses and then I'll use the variable myPath. So the comma just tells JMP that this is the second argument, not the first argument. So I'm not providing a prompt but I am telling the pick file function what directory to look in. So I'll run this. And this opens what looks like the open file dialogue and in fact the button I'll click when I have selected a file says Open but this is not opening a data table it's just returning a string that will be stored in f. So I'll click on Cure Time.jmp and I'll click Open. And there, of course, is that absolute path which includes the filename and the extension. And now, on a new line I could type dt and assign that the result of the open function taking f as its argument. So I'll run that line. So dt, again, is storing the data table Cure Time and we're able to first use pick directory to ask the user to say where the file is located and then have them actually pick the Cure Time file. And, again, a prompt certainly would not hurt in this case. Both cases, the prompts would be in the upper left corner of those windows. Now you can also use the open function without any arguments and that would just behave as though I had selected File Open but it will also return a data table object reference. So, again, the pick functions return character strings. Open returns a data table object reference.