ESelick Posted November 7, 2005 Share Posted November 7, 2005 Hi I need some help with run and runwait. I first used runwait() to start Visual Basic and setup some hotkeys that stayed live as long as I keep VB open. This was great; everything was working fine and I needed some problems. I decided that it would be nice to send some intialization keys and text when VB started up in order to open the correct project - class etc. It seemed that runwait() stopped the script too soon so I changed to run() and then controlled the timming with WinWaitActive and WinWaitClose(). This worked fine for the startup events, but the autoit script is finishing prematurely and I'm losing the original hotkeys when I start other applications. Is there anyway of using runwait() to really stop autoit from exiting and still be able to start the application and THEN send some initial autoit commands? How can I use run and then runwait for the same instance of the application. Or is there some other way of getting both the hotkey and initial startup commands. Thanks a bunch Elliot Link to comment Share on other sites More sharing options...
Developers Jos Posted November 7, 2005 Developers Share Posted November 7, 2005 $H_Pgm=Run("Your Program") Winwait("The program title") ; Wait till program is started ;Do initial sent stuff ControlSend() ; sent info to a control While ProcessExists($H_Pgm) sleep(10) WEnd ; DO stuff after program terminaed SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
blademonkey Posted November 7, 2005 Share Posted November 7, 2005 HiI need some help with run and runwait. I first used runwait() to start Visual Basic and setup some hotkeys that stayed live as long as I keep VB open. This was great; everything was working fine and I needed some problems. I decided that it would be nice to send some intialization keys and text when VB started up in order to open the correct project - class etc. It seemed that runwait() stopped the script too soon so I changed to run() and then controlled the timming with WinWaitActive and WinWaitClose(). This worked fine for the startup events, but the autoit script is finishing prematurely and I'm losing the original hotkeys when I start other applications.Is there anyway of using runwait() to really stop autoit from exiting and still be able to start the application and THEN send some initial autoit commands? How can I use run and then runwait for the same instance of the application. Or is there some other way of getting both the hotkey and initial startup commands.Thanks a bunchElliot Elliot,Post your code so we can take a looksy. my initial response would be, "yes, probably though the efficient use of a while loop". Unfortunately, I cannot create a while loop for you until i see your code.also, the Autoit Miracle Coders do well when they see your code, so that will help you out as well. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
ESelick Posted November 8, 2005 Author Share Posted November 8, 2005 $H_Pgm=Run("Your Program") Winwait("The program title"); Wait till program is started ;Do initial sent stuff ControlSend() ; sent info to a control While ProcessExists($H_Pgm) sleep(10) WEnd ; DO stuff after program terminaedCool, I will give it a spin and get back to you. I just keep on thinking of new ways to glue together my computing world with autoit.ThanksElliot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now