GlennRogers Posted October 11, 2013 Share Posted October 11, 2013 (edited) Hi all. In my script I use _IEAction to click a link in a webpage that then brings a popup windows titled "Message from webpage". I'm not sure why but I cannot interact with this window at all. local $wint = "Message from webpage" local $wintt = "You are about to change the status of the selected Carton(s). Are you sure you want to continue?" while 1 if WinExists($wint, $wintt) then sleep(1000) ControlSend("Message from webpage", "", "[CLASS:Button; INSTANCE:1]", "{enter}") sleep(1000) EndIf wend im trying the little bit of above code but cant get anything to work. Also tried just sending the enter key as at the time this window is focued anyway but it still did'nt work. The below HTML is what i have used _IEAction to click in order to make the popup appear. script/CI_CartonCancel.htc is stored in a folder of the URL. As an alternative I was wondering if there is any easy way to run that script without navigating away from the page that I am on? Thanks in advance. <a name="hid_Cancel Carton" id="hid_cancel" class="navlink" style="behavior:url('script/CI_CartonCancel.htc')" href= >Cancel Carton</a> Edited October 11, 2013 by GlennRogers Link to comment Share on other sites More sharing options...
michaelslamet Posted October 11, 2013 Share Posted October 11, 2013 Hi Glenn, Try this: If WinExists("Message from webpage") then WinActivate("Message from webpage") Send("{ENTER}") EndIf Link to comment Share on other sites More sharing options...
GlennRogers Posted October 11, 2013 Author Share Posted October 11, 2013 Hi Michael. didn't work Also when I use AU3 info I dont get any info about the control of the window, is that normal? Just the buttons. Link to comment Share on other sites More sharing options...
jdelaney Posted October 11, 2013 Share Posted October 11, 2013 (edited) do a forum search for deadlocked process. You either have to focus on the object that causes the window to open, and send enter at the window, or create a second process (call a second script) to use the _ie functions to click, so that process is deadlocked, and your initial script can interact with the window Edited October 11, 2013 by jdelaney 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. Link to comment Share on other sites More sharing options...
Gianni Posted October 11, 2013 Share Posted October 11, 2013 Hi GlennRogers it seems a problem similar to >this some popup windows "freezes" the script. if so,> this may be a solution good luck 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...
michaelslamet Posted October 11, 2013 Share Posted October 11, 2013 You could try to create a script that sit on the tray, waiting for the popup window to appear, then send {ENTER} keystroke, like this: While 1 $hWin = WinGetActive() If WinExists("Message from webpage") Then WinActivate("Message from webpage") Send("{ENTER}") WinActivate($hWin[0]) EndIf Sleep(10000) ; delay 10 secs to prevent our script hog the CPU WEnd Func WinGetActive() Dim $window[2] Dim $winlist $winlist = WinList() For $i = 1 To $winlist[0][0] If $winlist[$i][0] <> "" And IsVisible($winlist[$i][1]) Then $window[0] = $winlist[$i][0] $window[1] = $winlist[$i][1] ExitLoop EndIf Next Return $window EndFunc ;==>WinGetActive Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible 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