Created
August 8, 2011 22:49
-
-
Save johnlindquist/1132950 to your computer and use it in GitHub Desktop.
A script to launch or focus and refresh the Corona Simulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set WshShell = WScript.CreateObject ("WScript.Shell") | |
Set colProcessList = GetObject("Winmgmts:").ExecQuery ("Select * from Win32_Process") | |
'Check if Corona is already running | |
For Each objProcess in colProcessList | |
If objProcess.name = "Corona Simulator.exe" then | |
vFound = True | |
End if | |
Next | |
If vFound = True then | |
'If Corona is already running, then switch to it and refresh | |
WshShell.AppActivate "C:\Program Files (x86)\Ansca\Corona SDK\Corona Simulator.exe" | |
WScript.Sleep 100 | |
WshShell.SendKeys "{ESC}" | |
WScript.Sleep 100 | |
WshShell.AppActivate "Corona Simulator" | |
WScript.Sleep 200 | |
WshShell.SendKeys "^r" | |
Else | |
'If Corona isn't running, launch it with your main.lua | |
WshShell.Run """C:\Program Files (x86)\Ansca\Corona SDK\Corona Simulator.exe """ & WScript.Arguments(0) | |
End If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, thanks for the script, it helped a lot. However, refreshing the simulator does not work completely.
Line 16 needs a hyphen, like so:
WshShell.AppActivate "- Corona Simulator"
This will give focus to the simulator instead of the ouput, thus refreshing should work again.