markkrj Posted February 4, 2014 Posted February 4, 2014 Hi, can you guys help me? i need a script that click "ok" on 2 different error messages. My 2 scripts are already working fine if the software that bring me the error is activated, But if isn't, I need to click on the first message to start the script. first: while 1 ; Wait for the window to become active... $title = "Sistema Faraó - Apoio à Vendas"; the message title WinWaitActive($title) ControlClick($title, "OK", "[CLASS:Button;INSTANCE:1]") WEnd and then: while 1 ; Wait for the window to become active... $title = "Sistema Faraó - Apoio à Vendas"; the message title WinWaitActive($title) ControlClick($title, "OK", "[CLASS:Button;INSTANCE:1]") WEnd I also wanna know if is possible to make this in a single script.
JohnOne Posted February 4, 2014 Posted February 4, 2014 Explain a little more, it makes no sense. Both scripts look exactly the same to me. Make your priority describe what "the first message to start the script" means. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Danyfirex Posted February 4, 2014 Posted February 4, 2014 (edited) Edit: Wrong Topic :S Edited February 4, 2014 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
markkrj Posted February 4, 2014 Author Posted February 4, 2014 sorry about my english, this isn't my main language. With "first message" I wanna say the first error, because it comes in background, not in focus. So I need to bring it to foreground to the script work. the scripts are the same excpet the title. Because I always get the two errors together.
Solution JohnOne Posted February 4, 2014 Solution Posted February 4, 2014 (edited) Something like this... $title1 = "Sistema Faraó - Apoio à Vendas"; the message title $title2 = "Sistema Faraó - Apoio à Vendas"; the message title While 1 If WinExists($title1) Then WinActivate($title1) WinWaitActive($title1) ControlClick($title1, "", "[CLASS:Button;INSTANCE:1]") EndIf If WinExists($title2) Then WinActivate($title2) WinWaitActive($title2) ControlClick($title2, "", "[CLASS:Button;INSTANCE:1]") EndIf Sleep(250) WEnd Edited February 4, 2014 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
jdelaney Posted February 4, 2014 Posted February 4, 2014 If you run this in a loop, you will grab ALL visible windows of your process...it's very helpful for this kind of thing. You can then grab the handle, get the text/title/controls of the window, and figure out how to proceed. $a = _WinAPI_EnumProcessWindows($iPid) _ArrayDisplay($a) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
markkrj Posted February 5, 2014 Author Posted February 5, 2014 (edited) Thanks guys!! Now it's working fine! Was tired of clicking lol And John, realy the two scripts was exactly the same. The title should be different loool...Just fixed it in the code.. Thanks Mod can close the topic if want to... Edited February 5, 2014 by markkrj
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