Subscribe Bookmark RSS Feed

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

chulew

Community Trekker

Joined:

Sep 10, 2014

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!

5 REPLIES
msharp

Super User

Joined:

Jul 28, 2015

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

Community Trekker

Joined:

Sep 10, 2014

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

pmroz

Super User

Joined:

Jun 23, 2011

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

Community Trekker

Joined:

Sep 10, 2014

Very cool! Thanks!

chulew

Community Trekker

Joined:

Sep 10, 2014

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.