check whther a project is already openHello,
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
Automation and ScriptingRe: check whther a project is already openThanks for the tip. I'll give it a go
Re: check whther a project is already openGet 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());