I'm prompting the user to open a file via this script command:
Open() << Set Name( "results.jmp")
How do I capture the file path of the file that the user chose to open?
I would use the Pick File() function for this. You can restrict the file type and easily get the filepath.
Names Default To Here( 1 );
thepath = Pick File( "Choose the JMP table", "", {"JMP Data Table|jmp"} );
If( thepath != "",
Open( thepath ) << Set Name( "results.jmp" )
);
Using the Open() function with a file name will use the relative path. The default path can be found by call Get Default Directory().
I would use the Pick File() function for this. You can restrict the file type and easily get the filepath.
Names Default To Here( 1 );
thepath = Pick File( "Choose the JMP table", "", {"JMP Data Table|jmp"} );
If( thepath != "",
Open( thepath ) << Set Name( "results.jmp" )
);
This is the solution that worked for me. Thanks!