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
chulew
Level I

Can I view the log of an executable (\\!) JSL?

The first line of my jsl is \\! which makes it executable (running outside of, or without first starting, JMP.exe). My script no longer works now and relies on Get Current Directory() which returns a different path if I try to run it and view the log in JMP. Can a JSL write the standard JSL log to a text file which I can read in another text editor? My script runs as a service in the background and never stops waiting for input files.

Thanks!

6 REPLIES 6
msharp
Super User (Alumni)

Re: Can I view the log of an executable (\\!) JSL?

Try this:

//!

Open Log();

win = Window("Log");

Print("test");

ScriptBox = win[ScriptBox(1)];

text = ScriptBox << Get Text;

Save Text File("c:/Temp/Log.txt", text);

You can choose a different file path but c:/Temp is a generic location.

Log file should contain the script that executes and ends with "test" which we print.

chulew
Level I

Re: Can I view the log of an executable (\\!) JSL?

Thanks msharp! I'm going to try to implement this.

j0rg
Level I

Re: Can I view the log of an executable (\\!) JSL?

Hi This is very helpful however when I am running the script remotely with Task Scheduler its not reading the text = ScriptBox << Get Text; part.

 

Could anyone pls help with this!

 

pmroz
Super User

Re: Can I view the log of an executable (\\!) JSL?

For a little more control try the log capture() function.  Put the code you want to capture the log for inside the parentheses, and it returns what would have gone to the log window.  Thanks to craige for pointing that function out to me.

chulew
Level I

Re: Can I view the log of an executable (\\!) JSL?

Very cool! Thanks!

chulew
Level I

Re: Can I view the log of an executable (\\!) JSL?

I realized that if I launch my script manually (with \\!), the JMP main windows does open although Get Current Directory() returns my \\! script path which is what I want. If I understand correctly, \\! just prevents the script from being displayed (thanks Wendy M. @ JMP). Once the main JMP window opens, I was able to go to VIEW > LOG to see what was going on in my invisible script.