Hodahel Posted September 18, 2013 Share Posted September 18, 2013 Hey guys, I'm trying to make a little script to make some changes on IE everything works will until this popup with OK and Cancel button. I've already tried several codes like: $wint = "Message from webpage" $wintt = "Do you want to change current profile?" while 1 if WinExists("$wint", "$wintt") then Controlclick("$wint", "$wintt"), "Button1", "LEFT", 1) sleep(500) wend or while 1 if WinExists("[CLASS:#32770]") then Controlclick("[CLASS:#32770]", "Button1", "LEFT", 1) sleep(500) wend or If WinExists("Message from webpage") Then WinActivate("Message from webpage") Controlclick("[CLASS:#32770]", "OK", "Button1", "LEFT", 1, 44, 14) EndIf But still my script wont click the OK button.. When I tried to make all of the above script into EXE, then run it during the appearance of popup, the popup will close but when run inside the script with like runwait click_ok.exe, no effect.. Any idea to get me through it? TIA Link to comment Share on other sites More sharing options...
DW1 Posted September 18, 2013 Share Posted September 18, 2013 -I assume quoting the variables is a typo in the post, and you didn't actually do that in the script ("$wint", etc) -The first two that you posted will loop indefinitely as you are never exiting the infinite loop with ExitLoop AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Hodahel Posted September 18, 2013 Author Share Posted September 18, 2013 Yes just a typo..here is the correct code I used.. $wint = "Message from webpage" $wintt = "Do you want to change current profile?" while 1 if WinExists($wint, $wintt) then Controlclick($wint, $wintt, "Button1", "LEFT", 1) sleep(500) wend Here is another code I already tried.. If WinExists("Message from webpage") Then Controlclick("Message from webpage", "OK", "Button1", "LEFT", 1, 44, 14) EndIf Still I never make it to work.. Link to comment Share on other sites More sharing options...
Gianni Posted September 18, 2013 Share Posted September 18, 2013 (edited) also you say the popup has 2 buttons with OK and Cancel, in your script you use the string "Button1" in place of a controlID, what is "Button1"? Edited September 18, 2013 by PincoPanco Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 18, 2013 Moderators Share Posted September 18, 2013 (edited) As there have already been several questions seeking clarification, why not post your script in its entirety so we don't have to guess? Help us help you Edited September 18, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Kidney Posted September 18, 2013 Share Posted September 18, 2013 most of the time, that only pops up when there is a formsubmit. almost like a "Confirm" button. i would check to see if the section of code on the site you r working with has the button type as submit. if it does, use the formsubmit function and that "OK" button shouldnt appear. Link to comment Share on other sites More sharing options...
Hodahel Posted September 20, 2013 Author Share Posted September 20, 2013 OK guys, I manage to find the solution... Now I'm stuck here.. StringRegExpReplace ( "text_to_test", "pattern_vary in characters", "this_is_to_replace") pattern_vary in characters consist of 8 RANDOM character and ALWAYS start with four (4) ZERO, "0000" like 0000aex3, 0000yt67, etc.. How can I make it as valid pattern? BR Link to comment Share on other sites More sharing options...
Gianni Posted September 20, 2013 Share Posted September 20, 2013 where has your popup finished? Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Hodahel Posted September 20, 2013 Author Share Posted September 20, 2013 (edited) Yes done with the POPUP.. with this code.. ControlSend("Message from webpage", "", "[CLASS:Button; INSTANCE:1]", "{enter}") Thanks to this.. Edited September 20, 2013 by Hodahel Link to comment Share on other sites More sharing options...
Hodahel Posted September 22, 2013 Author Share Posted September 22, 2013 Nothing heard...I'm on my on again..goodluck to me. Link to comment Share on other sites More sharing options...
Kidney Posted September 23, 2013 Share Posted September 23, 2013 StringRegExpReplace ( "0000aex3", "0000wwww", "this_is_to_replace") this will look for 4 leading zeros and then A-Z, a-z and 0-9 or _ 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