Hi,
Using the
Run object directly with NIMax.exe will launch a new instance of NIMax each time - probably not what you want. However, to just "activate" or to bring-to-front the already-launched NIMax you can do the following:
Write a Script which will "activate" (brings-to-front) the NIMax. Then use the Run object in Lookout to run this Script.
There are two ways you can Script this task using
Windows Script Host, for instance:
1. Use the
AppActivate mehtod -- you pass the Title of the window ("Measurement & Automation Explorer" in our case) with the method. On execution of the script, the NIMax is made active. The only catch here is that the NIMax window must not be minimized to an Icon on the task bar
(it should be open; but can be behind your Lookout panels).
2. Actually simulate the
Alt+Tab keys from the Script. The
SendKeys method does just that -- sends the keys (Alt+Tab, in our case) to the system. The catch here is that this may open some other "third" Window if there happens to be one. Just like Alt+Tabbing would do if there are more windows.
I am attaching the two scripts; both of which have been tested to work fine.
NOTE the funky command with bunch of double-qoutes you need to use with the Run Object in Lookout:
"""WScript.exe"" ""C:\lookout5\Lookout 5.0\nimax.wsf"""
The above command worked in my case. See the following KB article as to why we need all these double-qoutes:
Using Lookout to Open an Application and a File in the ApplicationAnd see the following for more info' on
.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsoriWindowsScriptHost.asp>WSH S...Hope this helps.
Regards,
Khalid 🙂