Hey guys, has anyone encountered a JSL script that won't quit after a run program command? I am trying to determine if outlook is open and if not open it. Here is my code. Any help would be appreciated:
Names Default To Here( 1 ); // Make sure variables are stored in this procedure
Clear Log(); // Clear the JMP Log - Select View - Log
// Get the current windows processes (process list) using teh wmic.exe
windowsProcesses = RunProgram(executable("wmic"),options({"process list"}),
readfunction(function({this},write(this<<read)))
);
// Wait enough time for windows processes to get logged
Wait(30);
// Temporarily save log file for use later
Save Log( "C:\TEMP\Jmplog.txt" );
// Load the newly saved log file
windowsProcessText = Load Text File( "C:\TEMP\Jmplog.txt" );
// Check if outlook is open by searching the log file
openYesNo = If(contains(windowsProcessText,"Outlook"),1,0);
// Open Outlook if it is currently closed
If( openYesNo == 0,
RunProgram(Executable("C:\Program Files (x86)\Microsoft Office\Office16\Outlook.exe"))
);