Hello friend:
Recently I came across a tough issue with regard to the Hotkeys in JMP. And I originally intended to briefly introduce it, but it is too important for me. I have the right to let you know the entire matter, not the fragments.
Background:
Currently I am taking responsible for the JMP (JMP16) & Python report automation of whole department, so I established a report automation system (this system is on my PC, I am not a IT personnel in the company, so I don't have server to interact with users, just developed this system based on my interest, and I learned a lot for it) based on e-mail, it can automatically recieving the email with specific mail subject, and then will trigger the mail rule to pass a mail item object to python via VBA, then Python script will automatically generating the JMP report based on the attachment from mail item object and automatically replying previous mail with a report as attachment.
Issue:
As all we know, if we add "//!" into the first row in JSL, then we only double-click the JSL file, JSL will automatically running, but we can press CTRL to interrupt it and then the JSL pops out. As mentioned before, this system is running on my PC, so there will be two circumstances when users send the mail with specific subject to me:
Troubl Shooting:
Help Needed:
Need to replace CTRL to other buttons that are not commonly used to interrupt JSL.
I am looking forward to your reply, thanks a ton in advance.
I think you are asking about the escape key to interrupt JMP. Have you tried minimizing all the JMP windows? I think that might leave the keyboard focus somewhere else so JMP won't get the keystroke (maybe the desktop will receive it.) I think JMP has a minimize window function.
// the home window must not be open; I don't know how to access it,
// choose the pref for the jmp starter instead. You could manually
// minimize the home window instead. this only sets the pref, does
// not close the home window
// set preference(Initial JMP Window( "JMP Starter" ));
wait(1); // make sure windows open before minimizing them
windows = getwindowlist(); // does not get the home window
foreach({w},windows,show(w<<getwindowtitle);w<<Minimize Window( 1 ););
// with no window visible, escape does not stop this loop
for(i=1,i<20,i+=1,wait(1);print(i);beep());
You might need to make a user function out of that and call it each time you open a new analysis window. Or you could run the analysis without opening a window.
Craige, thanks for your reply and kindness!
At first, I want to show you two simple JSL examples:
without //!
//Save this JSL to desktop, and double click the JSL, you will find it will pop out, //but directly generate a new datatable, unless you manually click run button
newtable();with //!
//!
newtable();
//Save this JSL to desktop, and double click the JSL, you will find it will directly //generate a new data table.
The advantage of with //! is no need to click run button to run the JSL, so I take this way as a part of report automation system.
Secondly, I want to briefly clarify the process of this system again.
Ideally, this system should be perfect because the whole process is completely automation, but the point is this system runs on my PC, if someone send the mail with specific subject to me, the system will be activated and perform the above process, and if I am working at the same time and press CTRL+C/V to do some works, it will directly interrupt the JSL running, so it really has a huge risk when I am working and someone send the mail to me at the same time, thus I want to know how I can replace CTRL with other buttons to interrupt JSL. At least so far I think the only way to solve this issue is replace it after evaluated the whole process
Change the python code to launch JMP with a command line argument that specifies the .jsl file, rather than launching the .jsl file with the //! at the start.
JMP seems not to be in the path, so I grabbed the executable+path from the icon.
Sorry, that seems to also use the control key to suppress the script from running.
Thinking about it...
Probably not. The control key is not handled like the hot keys; it does not go through any of the menu interface.
What you might be able to do is use the automation interface (pdf) to control JMP from VB. I'm not sure if anyone has ever used automation from Python; it might be possible with pywin32 but a 10 minute effort won't be enough...