Sign in to follow this  
Followers 0
ktoya

activate IE tab is working in IE11 but not working in IE8

4 posts in this topic

there are 2 tabs in current IE window

www.a.com

www.b.com

and www.b.com is activated now I want to jump to www.a.com

the code is working in my Windows 7 x64 with IE 11. however it is not working in my windows xp VM with IE 8.

here is my code:

#Include <IE.au3>

local $oIE
$oIE=IEAttachByUrl($oIE,"http://www.google.com/")
;MsgBox(0,_IEPropertyGet($oIE, "locationurl"),_IEPropertyGet($oIE, "HWnd")))
WinActivate(_IEPropertyGet($oIE, "title"))

 Func IEAttachByUrl($IE, $url)
local $urlMatch
Local $aIE[1]
$aIE[0] = 0

Local $i = 1, $oIE
While 1
    $oIE = _IEAttach("", "instance", $i)
    If @error = $_IEStatus_NoMatch Then ExitLoop

$urlMatch=_IEPropertyGet($oIE, "locationurl")
ConsoleWrite($urlMatch)
if $url=$urlMatch Then
  return $oIE
    EndIf
    ReDim $aIE[$i + 1]
    $aIE[$i] = $oIE
    $aIE[0] = $i
    $i += 1
 WEnd
;MsgBox($MB_SYSTEMMODAL, "Browsers Found", "Number of browser instances in the array: " & $aIE[0])
EndFunc
 

 

Share this post


Link to post
Share on other sites



Did you try using _IEAttach like this?

$oIE = _IEAttach("http://www.google.com/", "url")

Share this post


Link to post
Share on other sites

yes I tried and it is also working fine in IE 11, but still not working in IE8. does Autoit no longer support low version of IE?

Share this post


Link to post
Share on other sites

Please expand on "not working in IE8". Is the _IEAttach failing or is the tab just not becoming active (topmost)?

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  
Followers 0