cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
terapin
Level VI

Run Task Scheduler without Opening New JMP Instance

I'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?

1 ACCEPTED SOLUTION

Accepted Solutions
terapin
Level VI

Re: Run Task Scheduler without Opening New JMP Instance

Thanks for the intriguing and very useful suggestion.  Although I haven't had any issues with the way I've been using the single data file, I definitely see where your suggestion of an "interactive" copy of the data file would have some advantages.

 

Regarding the multiple instances of JMP issue, in my case the issue was only resolved when I set file type(s) to open with a specific program through the Windows Control panel and as shown below from Program Note 52261.

 

 

terapin_0-1631567261493.png

 

View solution in original post

8 REPLIES 8
txnelson
Super User

Re: Run Task Scheduler without Opening New JMP Instance

You 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.

Jim
terapin
Level VI

Re: Run Task Scheduler without Opening New JMP Instance

I'll take a peek Jim and see if this works better than the Task Scheduler.

vince_faller
Super User (Alumni)

Re: Run Task Scheduler without Opening New JMP Instance

A 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.  

Vince Faller - Predictum
terapin
Level VI

Re: Run Task Scheduler without Opening New JMP Instance

I 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");

 

vince_faller
Super User (Alumni)

Re: Run Task Scheduler without Opening New JMP Instance

Oh 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

Vince Faller - Predictum
terapin
Level VI

Re: Run Task Scheduler without Opening New JMP Instance

Jeff,

 

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?

ih
Super User (Alumni) ih
Super User (Alumni)

Re: Run Task Scheduler without Opening New JMP Instance

An additional option is to separate getting data from visualizing it.  Let task scheduler script open a new copy of JMP each time and update a data table on your computer somewhere. Then in your 'interactive' copy of JMP include a script to periodically refresh from the file saved by the other script.  This tends to give a better user experience because any delays in the connection to the source data don't result in JMP hanging up or lagging when interacting with a graph. 

 

As to getting jsl files to open in the same instance of JMP, I recommend reaching out to JMP Support to resolve that issue.

terapin
Level VI

Re: Run Task Scheduler without Opening New JMP Instance

Thanks for the intriguing and very useful suggestion.  Although I haven't had any issues with the way I've been using the single data file, I definitely see where your suggestion of an "interactive" copy of the data file would have some advantages.

 

Regarding the multiple instances of JMP issue, in my case the issue was only resolved when I set file type(s) to open with a specific program through the Windows Control panel and as shown below from Program Note 52261.

 

 

terapin_0-1631567261493.png