wklw2005 Posted March 27, 2012 Posted March 27, 2012 (edited) Hello, I am trying to create a package for my designers for viewing models. 6 apps total, I have all the code written out for all apps. I tried to use ShellExecute, but it's not waiting until the 1st app is finished before going to the next app. I tried ShellExecuteWait, but I can't seem to get it to work at all. ShellExecutewait runs the msi then stops and will not move to the next line. WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") sleep(2000) Send('{SPACE}') Can someone please help! ShellExecutewait("ServernameNavigator.msi") WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") sleep(2000) Send('{SPACE}') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') Edited March 27, 2012 by wklw2005
DelStone Posted March 27, 2012 Posted March 27, 2012 Have you tried ShellExecute? After running the requested program the script continues with this command. To pause execution of the script until the spawned program has finished the ShellExecuteWait function is usually used - which appears to be what you are doing...
wklw2005 Posted March 27, 2012 Author Posted March 27, 2012 Have you tried ShellExecute?After running the requested program the script continues with this command.To pause execution of the script until the spawned program has finished the ShellExecuteWait function is usually used - which appears to be what you are doing...Thanks for the reply... Yes, ShellExecute works great but shellExecute will not wait til the spawned program has finished. I can't seem to get ShellExecuteWait to work.
DelStone Posted March 27, 2012 Posted March 27, 2012 Probably because the app (msi) has to end before it moves on... are you waiting till it terminates before you are checking for a window or is the window you are checking for from the msi app?
wklw2005 Posted March 27, 2012 Author Posted March 27, 2012 (edited) I am not sure what your asking, but here is the code for 2 apps. ; ShellExecute("ServernameNavigator.msi") WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") sleep(2000) Send('{SPACE}') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('Enter') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') WinWaitActive("Bentley Navigator V8i (SELECTseries 3) 08.11.08.43 Setup","") Send('{SPACE}') ShellExecute("ServernameRealDwg2010.msi") WinWaitActive("Bentley V8i (SELECTseries 2) - Autodesk® RealDWG™ 2010 Setup","Welcome to the Bentley V8i (SELECTseries 2) - Autodesk® RealDWG™ 2010 Setup Wizard") Sleep(2000) Send('{SPACE}') WinWaitActive("Bentley V8i (SELECTseries 2) - Autodesk® RealDWG™ 2010 Setup","") Send('{SPACE}') Send('Enter') WinWaitActive("Bentley V8i (SELECTseries 2) - Autodesk® RealDWG™ 2010 Setup","") Send('{SPACE}') WinWaitActive("Bentley V8i (SELECTseries 2) - Autodesk® RealDWG™ 2010 Setup","") Send('{tab}') Send('{SPACE}') Send('{tab}') Send('{SPACE}') Edited March 27, 2012 by wklw2005
DelStone Posted March 27, 2012 Posted March 27, 2012 Try winwait instead of winwaitactive - which app are you trying to automate
BrewManNH Posted March 27, 2012 Posted March 27, 2012 Your problem is that your window title and text are the same for every WinWaitActive, so it's going to see the first window as the correct window for all of them and will just keep going. You need some way to identify the individual windows so that doesn't happen, if the text changes for every window you need to Send to, then use the text parameter. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
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