cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Sburel
Level IV

check whther a project is already open

Hello,

 

I have a script which is part of an add-in. When the script is launched, it triggers the creation of a project (project=new project (...)). However, when I'm debugging the script, I typically run it with a project already open and use the code project=this project().

 

I would like to make the script smarter so that if a project(s) is already open then it run automatically into the open project (or ask which project to run it into, or give the option to create a new script). if no project is open then it would first create a project.

 

Sugestions?

 

Thanks

 

 

2 REPLIES 2
jthi
Super User

Re: check whther a project is already open

Get Project List() might be what you are looking for. You can check if there are any projects open for example by checking the list returned from Get Project List() with N Items().

 

Example from scripting index

Names Default To Here(1);
New Project();
Open("$SAMPLE_PROJECTS/Big Class.jmpprj");
                             
Print(Get Project List() << Get Window Title());
-Jarmo
Sburel
Level IV

Re: check whther a project is already open

Thanks for the tip. I'll give it a go