- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can I view the log of an executable (\\!) JSL?
Thanks msharp! I'm going to try to implement this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Can I view the log of an executable (\\!) JSL?
Very cool! Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.