guimenez Posted May 15, 2008 Share Posted May 15, 2008 (edited) Hello i want to make a script that when the device manager finish to install the drivers, the script do the "Enter" or "alt+f" key, because after driver installation it asks for click finish. i'see that the device manager is "mmc.exe" i hope someone can help me many thanks Edited May 15, 2008 by guimenez Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 15, 2008 Share Posted May 15, 2008 Helloi want to make a script that when the device manager finish to install the drivers, the script do the "Enter" or "alt+f" key, because after driver installation it asks for click finish.i'see that the device manager is "mmc.exe" i hope someone can help memany thanksLook at ControlSend() in the help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 15, 2008 Author Share Posted May 15, 2008 hi again i've made this progrss WinWaitActive("Assistente de actualização de hardware") Send("{ENTER}") but just do one time in the first dialog. i want to loop forever till a close the script thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 15, 2008 Share Posted May 15, 2008 i want to loop forever till a close the scriptLook at While/WEnd or Do/Until in the help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 15, 2008 Author Share Posted May 15, 2008 Please help me i know 0% about programming, please give me the code to make that i want every time that the window appear it press enter. please Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 15, 2008 Share Posted May 15, 2008 Please help mei know 0% about programming, please give me the code to make thati want every time that the window appear it press enter.pleaseI am trying to help. Writing scripts for you is not what we do here. We help people learn and use AutoIt, learning it in the process also, in my case. You start learning AutoIt from the AutoIt3.chm help file that came with it. There are basic tutorials in there and example scripts attached to almost every function listed.Try the tutorials, then experiment with the examples under While/WEnd. You'll be coding loops in no time!If you get stuck, post your code here for more help/explanation.If you just want someone to write it for you, go to Rent-A-Coder in my sig. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 16, 2008 Author Share Posted May 16, 2008 hiyou are right, i need to try it.ok now its almost workingthis is my code:$i = 0DoWinWaitActive("Assistente de actualização de hardware")Send("{ENTER}")$i = $i + 1Until $i = 100it works very well, the main problem its that it just work if the window is active, i think it the WinWaitActive - do you know whatis the command to do that without waiting for the active window?many thanks, now i'm liking programming Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 16, 2008 Share Posted May 16, 2008 (edited) hi you are right, i need to try it. ok now its almost working this is my code: $i = 0 Do WinWaitActive("Assistente de actualização de hardware") Send("{ENTER}") $i = $i + 1 Until $i = 100 it works very well, the main problem its that it just work if the window is active, i think it the WinWaitActive - do you know what is the command to do that without waiting for the active window? many thanks, now i'm liking programming Yes, ControlSend() has the parameters to specify the target window, even if it's minimized, and should generally be used in place of Send() because it is more reliable: ControlSend("Assistente de actualização de hardware", "", "", "{ENTER}") Check it out in the help file. P.S. You probably want a Sleep(250) inside that loop to keep it from sucking up all your CPU cycles. Edited May 16, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 16, 2008 Author Share Posted May 16, 2008 Thanks a lot, it work like a charm thanks the worst problem its that when xp install and appears the drivers, it doesn't permit run the exe before the drivers, so my experience doesn't work. But many thanks, because now i'm learning something about programming Link to comment Share on other sites More sharing options...
guimenez Posted May 20, 2008 Author Share Posted May 20, 2008 Hi Unfortunately, it won't work 100% ok this is my code now $i = 0 Do WinWaitActive("Assistente de novo hardware encontrado") Send("!s") WinWaitActive("Assistente de novo hardware encontrado") Send("{ENTER}") $i = $i + 1 Until $i = 10000 The Enter its not a good point, because sometimes it return to previous window. How can i know what is the button (Finish) and (Next) may be i can use the button like this WinWaitActive("Assistente de novo hardware encontrado") Send("Next button") WinWaitActive("Assistente de novo hardware encontrado") Send("Finish Button") Please, hope anyone can help me with the buttons Thanks Link to comment Share on other sites More sharing options...
weiny Posted May 20, 2008 Share Posted May 20, 2008 Open up the AutoIt Window Info program. You can find more information on the various windows and buttons to ensure you always select the one you want.http://www.autoitscript.com/autoit3/docs/intro/controls.htm Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 20, 2008 Share Posted May 20, 2008 The Enter its not a good point, because sometimes it return to previous window. How can i know what is the button (Finish) and (Next) may be i can use the button like this WinWaitActive("Assistente de novo hardware encontrado") Send("Next button") WinWaitActive("Assistente de novo hardware encontrado") Send("Finish Button") Please, hope anyone can help me with the buttons Thanks Use the AU3Info.exe tool to examine the windows involved. You should see control information for the buttons. If the buttons are created with the window, their text may be visible in WinGetText(). Again, the AutoIt Window Info tool will show you what is there. If "Next" has the "N" underlined to indicate the Alt-n hot key, then the text for the button might be "&Next", or "&Finish". You can then test for it with something like: WinWait("Assistente de novo hardware encontrado") $sWinText = WinGetText("Assistente de novo hardware encontrado") If StringInStr($sWinText, "&Next") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!n") ElseIf StringInStr($sWinText, "&Finish") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!f") EndIf Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
faire Posted May 20, 2008 Share Posted May 20, 2008 Look up "WinZip Installation" in the help file. It's a great tutortial to learn the basics on window automation. Link to comment Share on other sites More sharing options...
guimenez Posted May 21, 2008 Author Share Posted May 21, 2008 Thanks for all traying to help me ok, i will try it in the afternoon The problem its that the Finish don't have the F underlined, but i will try it. many thanks Link to comment Share on other sites More sharing options...
guimenez Posted May 21, 2008 Author Share Posted May 21, 2008 okthis is what i did, but doesn't make nothing $i = 0DoWinWait("Assistente de novo hardware encontrado")$sWinText = WinGetText("Assistente de novo hardware encontrado")If StringInStr($sWinText, "$Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s")ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "ENTER")EndIf$i = $i + 1Until $i = 10000this are the 2 screenshots of my windowsscreenshot 1st windows: http://img186.imageshack.us/my.php?image=window1hj9.jpgscreenshot 2st windows: http://img329.imageshack.us/my.php?image=window2ef9.jpgthanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 21, 2008 Share Posted May 21, 2008 (edited) If StringInStr($sWinText, "$Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s")ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "ENTER")EndIfDon't put the variable name inside quotes unless you want to test for that literal string "$Seguinte". If that is button text with the "S" underlined then it is more likely "&Seguinte" you want.The Send code for enter is "{ENTER}", what you have sends five letters: E N T E RTry: If StringInStr($sWinText, "&Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s") ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "{ENTER}") EndIfIf that was supposed to be a variable, then: If StringInStr($sWinText, $Seguinte) Then Edit: added more info Edited May 21, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 26, 2008 Author Share Posted May 26, 2008 Hi people, finally i'm almost done it work flawless but now i have a 3rd window, please how can i do to keep the auto click option this is my working code: $i = 0 Do WinWait("Assistente de novo hardware encontrado") $sWinText = WinGetText("Assistente de novo hardware encontrado") If StringInStr($sWinText, "Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s") ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "{ENTER}") EndIf $i = $i + 1 Until $i = 10000 My new window as the info "Alteração das definições do Sistema" and the button says "Sim" with S underlined thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 27, 2008 Share Posted May 27, 2008 Hi people, finally i'm almost doneit work flawless but now i have a 3rd window, please how can i do to keep the auto click optionthis is my working code:$i = 0DoWinWait("Assistente de novo hardware encontrado")$sWinText = WinGetText("Assistente de novo hardware encontrado")If StringInStr($sWinText, "Seguinte") ThenControlSend("Assistente de novo hardware encontrado", "", "", "!s")ElseIf StringInStr($sWinText, "Concluir") ThenControlSend("Assistente de novo hardware encontrado", "", "", "{ENTER}")EndIf$i = $i + 1Until $i = 10000My new window as the info "Alteração das definições do Sistema"and the button says "Sim" with S underlinedthanksJust repeat the process that worked before:1. Use AU3Info.exe to gather information on the Window/Control.2. Make sure your script is referencing the correct window.3. Make sure your script is referencing the correct control.If you get stuck post the code for the part that doesn't work, but try to get it yourself first.Like the Waterboy: "You can DOO IT! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
guimenez Posted May 31, 2008 Author Share Posted May 31, 2008 thanks once again this is my new code $i = 0 Do WinWait("Assistente de novo hardware encontrado") $sWinText = WinGetText("Assistente de novo hardware encontrado") If StringInStr($sWinText, "Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s") ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "{ENTER}") EndIf WinWait("Alteração das definições do sistema") $aWinText = WinGetText("Alteração das definições do sistema") If StringInStr($aWinText, "Sim") Then ControlSend("Alteração das definições do sistema", "", "", "!s") EndIf $i = $i + 1 Until $i = 10000 but it seems that don't do the 3rd window that appears in the final thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 31, 2008 Share Posted May 31, 2008 thanks once again this is my new code $i = 0 Do WinWait("Assistente de novo hardware encontrado") $sWinText = WinGetText("Assistente de novo hardware encontrado") If StringInStr($sWinText, "Seguinte") Then ControlSend("Assistente de novo hardware encontrado", "", "", "!s") ElseIf StringInStr($sWinText, "Concluir") Then ControlSend("Assistente de novo hardware encontrado", "", "", "{ENTER}") EndIf WinWait("Alteração das definições do sistema") $aWinText = WinGetText("Alteração das definições do sistema") If StringInStr($aWinText, "Sim") Then ControlSend("Alteração das definições do sistema", "", "", "!s") EndIf $i = $i + 1 Until $i = 10000 but it seems that don't do the 3rd window that appears in the final thanks Please start using Tidy (Ctrl-t in SciTE) to format your script, and then put it in code tags. Makes it much easier to read... The script you posted only has handlers for two windows, where does this third window show up in there? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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