In this script below, I'm trying to:
- Create an Internet Explorer, and to navigate it to a blank page.
- Create a new tab with a blank page.
- Create another tab again. (Please don't ask me why 'cause it's just a test.)
- Get all the 3 object variables pointing to those 3 InternetExplorer Objects.
- And to test to select the tab two, then to select the tab one which is fail!
AutoIt
#include <IE.au3> $oIE = _IECreate("about:blank", 0, 1, 1, 1) __IENavigate($oIE, "about:blank", 0, 0x800) __IENavigate($oIE, "about:blank", 0, 0x800) Local $oTabs[1] Local $i = 1 While 1 $oTabs[$i - 1] = _IEAttach($oIE, "instance", $i) If @Error = $_IEStatus_NoMatch Then ReDim $oTabs[$i - 1] ExitLoop EndIf ReDim $oTabs[$i + 1] $i += 1 WEnd Sleep(3000) _IEAction($oTabs[1], "focus") Sleep(3000) _IEAction($oTabs[0], "focus")
Could you please tell me how to fix that AU3 code to select and not to WinActivate() the tab because as far as I know, activating tab will make this tab at the front of the your Windows screen which I do not want because I want to automate the IE even I'm working on a different application.
Now, this is my second question! How can I get the current selected tab on a web browser, specially in Internet Explorer, even I'm in another application to read that tab's text using the _IEBodyReadText() libfunction? Thanks for any help!