html application help(.hta)?

fireball755

New member
I'm writing a very basic hta script to help me with my work. i have the following sub.
Sub log


Set objShell = CreateObject("WScript.Shell")
objShell.Run "killq 3", 0, false

objShell.SendKeys "{TAB}"
objShell.SendKeys "{ENTER}"



End Sub

i have it set to run the particular program (killq) which starts an executable. It is suppose to then tab and enter in the opened program, but its hitting tab and enter before the exe opens up. I've attempted to just use a delay, but .sleep doesn't work in hta, and the for loop approach doesn't work on all computers(some process faster then others and if it takes to long windows freaks out). I need a way to have the subroutine wait until the executable fully opens and is in focus to continue with the {tab} and {enter} command. Anyone have any suggestions?
 
Back
Top