When running a JSL script from within a project, you can use the This Project() function to obtain that project. The following example displays the name of the current project in a new window.
project = This Project();
If( Is Empty( project ),
New Window( "My Project", Text Box( "Script isn’t running in a project." ) ), // if the script is not run from a project, display this
);// if the script is run from a project, display the window title
Get Project() takes the same arguments as the Window() function. Omit the arguments to get a list of the currently open projects, include a string to find a specific project by title, or include a number to get the ith open project.
Open( "$SAMPLE_PROJECTS/Big Class.jmpprj" );
Open( "$SAMPLE_PROJECTS/Sports.jmpprj" );
Get Project() is also helpful when you want to save a project or set the layout from within the project.