Jump to content
Sign in to follow this  

Cannot interact with "Message from webpage" IE popup

Recommended Posts


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
ControlSend("Message from webpage", "", "[CLASS:Button; INSTANCE:1]", "{enter}")

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 by GlennRogers

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

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 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.

Share this post

Link to post
Share on other sites

Hi GlennRogers

it seems a problem similar to >this
some popup windows "freezes" the script. if so,> this may be a solution

good luck

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post

Link to post
Share on other sites

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")
    Sleep(10000) ; delay 10 secs to prevent our script hog the CPU

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]
    Return $window
EndFunc   ;==>WinGetActive

Func IsVisible($handle)
    If BitAND(WinGetState($handle), 2) Then
        Return 1
        Return 0
EndFunc   ;==>IsVisible

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this