Run Task Scheduler without Opening New JMP InstanceI'm trying to run a JSL script that updates various data tables every 3-hours by using the Windows Task Scheduler. Unfortunately, each time the JSL is run it opens a new instance of JMP instead of using the existing one that's already open. Is there a trick to completing this task automation without a new instance of JMP being opened each time the Task Scheduler calls the JSL file?
ScriptingRe: Run Task Scheduler without Opening New JMP InstanceYou might want to look into the Schedule() function in JMP. It runs in a given JMP session, and reruns the code in the same session.
Re: Run Task Scheduler without Opening New JMP InstanceA couple of options.
1. Why not just let it open a new instance, then just close it at the end of the JMP Script?
2. put `//!` at the beginning of the script and just open it. It should open in your currently registered version of jmp and auto run.
3. save the .jsl as a .jrp and it should do the same thing as 2.
I personally prefer non-interactive things like this to do 1 because then I can confirm that JMP closed appropriately in powershell so that I can give better console error messages.
Re: Run Task Scheduler without Opening New JMP InstanceI'll take a peek Jim and see if this works better than the Task Scheduler.
Re: Run Task Scheduler without Opening New JMP InstanceI want the process run in the existing instance so that I can periodically plot/evaluate recently collected data without having to open JMP each time.
I had been using Option 2 already, but it and Option 3, always open a new instance of JMP rather than executing within the already open instance. If you run the following script multiple times does it run within the current instance of JMP or does it also open a new instance for each execution? Curious if you get a different behavior than me.
//!
Clear Log();
Print ("Hello World");
Re: Run Task Scheduler without Opening New JMP InstanceOh that's likely because your registry got messed up. Cause it runs great for me. Does it do that even if you open a JMP data table? On Windows?
Answer Stolen from here
I believe you can correct this with the following.
- Exit out of all JMP sessions that are running
- Run the JMP version you wish to use as the default JMP version (if you happen to have multiple JMP versions installed on your machine)
- Go to File-->Preferences-->Windows Specific, then click on the Reset Associations button near the bottom of the dialog window
That should fix the Windows Registry to associate the current JMP session with JMP files.
Now try double clicking on your files and see if it behaves as expected.
Let us know if that fixes it.
-Jeff
Re: Run Task Scheduler without Opening New JMP InstanceJeff,
Thanks for the suggestions. Unfortunately, the recommended steps didn't correct the issue. Interestingly, another machine of mine that's running JMP and JMP Pro doesn't have the same issue. On the machine where the problem is now occurring (I recently updated from JMP 15 to 16) I tried the steps you provided and I still have the same issue where multiple instances are opened with each double click on a JSL file. I've gone as far as uninstalling all JMP versions, rebooting the computer and reinstalling to just JMP 16, but continue to have a new instance of JMP open with each launch of a JSL file (running Hello World script shown above as well as another script that opens a data table). Any further ideas on how to resolve this?