kenp11w Posted February 13, 2006 Share Posted February 13, 2006 Hi All, I have a script that waits for an Adobe pop-up. The pop-up occurs during version mismatch with documents. AutoIT will miss the window if it pops up behind another window. We have an application menu that must be open and always on top status. Occasionally the Adobe pop-up will occur behind the window or any other window open at the time. We have to manually minimize the top window or bring the adobe po-up into focus before AutoIT "Sees the Window Title". We are using the option opt("WinDetectHiddenText",1) Any ideas on how the window can be trapped in background or wen its hidden behind another? 1. See attachment in Word Doc of the hidden window that does not have focus. 2. See Code below: ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; ; Script Function: ; Close Adobe pop-up version check. ; ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "This script will run reply to the Adobe popup. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf $i = 0 While $i <= 10 opt("WinDetectHiddenText",1) ; Wait for the Adobe Window to become active - it is titled "Adobe" on English systems WinWaitActive("Adobe Acrobat","This") ; Now that the window is active type enter ; Use Send Enter Send("{ENTER}") ; Now quit by request WinClose("Adobe Acrobat","This") ; Now wait for nect pop-up before continuing WinWaitClose("Adobe Acrobat","This") WEndHiddenWindow.doc Link to comment Share on other sites More sharing options...
Methos Posted February 13, 2006 Share Posted February 13, 2006 Hrm, if its a child window of another window, try setting this option: Opt("WinSearchChildren", 1) good luck! Link to comment Share on other sites More sharing options...
kenp11w Posted February 16, 2006 Author Share Posted February 16, 2006 Hrm, if its a child window of another window, try setting this option:Opt("WinSearchChildren", 1) good luck!I tired your option Opt("WinSearchChildren", 1) as well as Opt("WinDetectHiddenText",1) andWinActivate("Adobe Acrobat","This") No luck. It still does not find the pop-up until i move it up by refocusing Link to comment Share on other sites More sharing options...
MHz Posted February 17, 2006 Share Posted February 17, 2006 Just a guess as cannot test or use AutoIt Info Tool on the picture, but it may spur on the answer for you if it is not exactly right. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "This script will run reply to the Adobe popup. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf Opt("WinDetectHiddenText", 1) $i = 0 While $i <= 10 ; Wait for the Adobe Window to exist - it is titled "Adobe" on English systems If WinExists("Adobe Acrobat", "This file appears to use a new format") Then ; Check the Checkbox to not show window again ControlCommand("Adobe Acrobat", "This file appears to use a new format", 'Button1', 'Check') ; Click the OK button ControlClick("Adobe Acrobat", "This file appears to use a new format", 'Button2') ; Now wait for next pop-up before continuing WinWaitClose("Adobe Acrobat", "This file appears to use a new format") EndIf ; Idle CPU Sleep(500) WEnd The window would not need to be active if you use WinWait(), WinExists and Control*() functions in your script. Link to comment Share on other sites More sharing options...
kenp11w Posted February 21, 2006 Author Share Posted February 21, 2006 Just a guess as cannot test or use AutoIt Info Tool on the picture, but it may spur on the answer for you if it is not exactly right. ; Prompt the user to run the script - use a Yes/No prompt (4 - see help file) $answer = MsgBox(4, "AutoIt Example (English Only)", "This script will run reply to the Adobe popup. Run?") ; Check the user's answer to the prompt (see the help file for MsgBox return values) ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf Opt("WinDetectHiddenText", 1) $i = 0 While $i <= 10 ; Wait for the Adobe Window to exist - it is titled "Adobe" on English systems If WinExists("Adobe Acrobat", "This file appears to use a new format") Then ; Check the Checkbox to not show window again ControlCommand("Adobe Acrobat", "This file appears to use a new format", 'Button1', 'Check') ; Click the OK button ControlClick("Adobe Acrobat", "This file appears to use a new format", 'Button2') ; Now wait for next pop-up before continuing WinWaitClose("Adobe Acrobat", "This file appears to use a new format") EndIf ; Idle CPU Sleep(500) WEnd The window would not need to be active if you use WinWait(), WinExists and Control*() functions in your script. This works well. It finds the window in all cases. I saw that if i removed SLEEP(500) it uses more CPU. Is that the affect of the functions used? Link to comment Share on other sites More sharing options...
kenp11w Posted February 21, 2006 Author Share Posted February 21, 2006 Is there anyway to make it use less CPU or is the SLEEP option used for that reason? Link to comment Share on other sites More sharing options...
ChrisL Posted February 21, 2006 Share Posted February 21, 2006 Is there anyway to make it use less CPU or is the SLEEP option used for that reason?That is what the sleep is for [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
kenp11w Posted February 22, 2006 Author Share Posted February 22, 2006 That is what the sleep is forThanks for all your help. 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