carlleese Posted July 26, 2008 Share Posted July 26, 2008 Hi all I need somones help please on this I have created a code to extract data from a webbased program but it keeps stopping when I get these random popups. What I need to do as soon as these popups come on, go to a code in autoit to close them down straight away by just pressing okay on them with a mouse or pressing enter. Then go back to the line of code I was on before this popup happened. the way I would identify these popups would be this code $dec5 = 0 For $forvar5 = 300 To 318 For $for5 = 189 To 200 $dec5 += PixelGetColor($forvar5, $for5) Next next if $dec5 = 187531170 Then MouseMove(260, 80) MouseClick("left") EndIf maybe a funct command would do this I am not sure any help on this would be appreciated Carl Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 26, 2008 Share Posted July 26, 2008 Hi allI need somones help please on thisI have created a code to extract data from a webbased program but it keeps stopping when I get these random popups. What I need to do as soon as these popups come on, go to a code in autoit to close them down straight away by just pressing okay on them with a mouse or pressing enter. Then go back to the line of code I was on before this popup happened.the way I would identify these popups would be this code$dec5 = 0For $forvar5 = 300 To 318 For $for5 = 189 To 200 $dec5 += PixelGetColor($forvar5, $for5) Next next if $dec5 = 187531170 Then MouseMove(260, 80)MouseClick("left")EndIfmaybe a funct command would do this I am not sure any help on this would be appreciatedCarlThese pop ups are either IE windows, which would be handled with _IE* functions, or they are regular Windows API windows. For regular windows, examine them with AU3Info.exe and you should get much more reliable information for detecting them, finding the button, and clicking 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...
carlleese Posted July 26, 2008 Author Share Posted July 26, 2008 (edited) These pop ups are either IE windows, which would be handled with _IE* functions, or they are regular Windows API windows. For regular windows, examine them with AU3Info.exe and you should get much more reliable information for detecting them, finding the button, and clicking it. hi These popups are API windows and they have no title names so I will have to identify them with pixels unless anyone knows of better way to identify them. Also because these popups can come on at anytime I will have to use the AdlibEnable I have seen in the help menu which is this. AdlibEnable("myadlib") ;... Exit Func myadlib() If WinActive("Error") Then ;... EndIf EndFunc Can someone please confirm to me that this is right AdlibEnable("myadlib") ;I put my full script in this bit Exit Func myadlib() ; then the script to identify my popup I put this $dec5 = 0 For $forvar5 = 300 To 318 For $for5 = 189 To 200 $dec5 += PixelGetColor($forvar5, $for5) Next next If $dec3 = 1633240260 Then MouseMove(870, 470) MouseClick("left") EndIf EndFunc Edited July 26, 2008 by carlleese Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 27, 2008 Share Posted July 27, 2008 hi These popups are API windows and they have no title names so I will have to identify them with pixels unless anyone knows of better way to identify them. Also because these popups can come on at anytime I will have to use the AdlibEnable I have seen in the help menu which is this. AdlibEnable("myadlib") ;... Exit Func myadlib() If WinActive("Error") Then ;... EndIf EndFunc Can someone please confirm to me that this is right AdlibEnable("myadlib") ;I put my full script in this bit Exit Func myadlib() ; then the script to identify my popup I put this $dec5 = 0 For $forvar5 = 300 To 318 For $for5 = 189 To 200 $dec5 += PixelGetColor($forvar5, $for5) Next next If $dec3 = 1633240260 Then MouseMove(870, 470) MouseClick("left") EndIf EndFunc Go back to AU3Info.exe and get the class, visible text, etc. That will still be more reliable that pixel checking. You should find they are something like CLASS:#32770, with some visible text. Maybe a Button1 control with "OK" for text, etc. 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