IE COM get another window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

IE COM get another window

07 Aug 2017, 07:05

I have a problem when I try to click some button in one window, which leads me to another window. The problem is getting the second window. My method works only if the new window will be opened sooner then sleeps ends, if not, most probably I will get an error message that variable was not found, so I think the loop doesn't work. Maybe someone can look at my code and give me advice where I'm wrong and how to fix it to have a smooth moving between windows?

Code: Select all

pwb := IEGet("Service")
pwb.Visible := True
pwb.document.getElementById("contentIFrame0").contentDocument.getElementById("gridBodyTable").getElementsByClassName("ms-crm-List-Row")[0].getElementsByTagName("a")[0].click()
Wait(pwb)
Sleep 1000
Loop{
    pwb := IEGet("Service")
    sleep 100
    tekstas := pwb.document.getElementById("contentIFrame0").contentDocument.getElementById("OverviewTab_header_h2").innerText
}until (tekstas != "")

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: peter_ahk, Ragnar, septrinus, yuu453 and 300 guests