Sign in to follow this  
Followers 0
jisevereid

Sending commands to IE

3 posts in this topic

I have 2 scripts that gets the current IE window and directs it a webpage. The problem that I am having is that often times there is more than one tab open and my script won't work properly when the focus is on the second tab. To try and fix this I am trying to send IE the command to change to the first tab which is "Control + 1" and then navigate to the desired link. However, I cannot seem to get my script to change to the first tab before navigating to the link.

This is my first script

#include <IE.au3>
#AutoIt3Wrapper_run_debug_mode=Y


Func IE_Navigate_Map()
    Local $title = WinGetTitle ("[CLASS:IEFrame]")
    Local $trimTitle = StringTrimRight($title, 20)
    Local $oIE = _IEAttach($trimTitle)
    _IENavigate($oIE, "https://www.google.com/maps/d/viewer?mid=1itdKt_5_qG_pIxM5N49qNK55rkM&ll=43.84185846009771%2C-91.24873084573369&z=9")
EndFunc

Send("^1")
IE_Navigate_Map()

This is my second script

#include <IE.au3>
#AutoIt3Wrapper_run_debug_mode=Y


Func IE_Navigate_Web()
    Local $title = WinGetTitle ("[CLASS:IEFrame]")
    Local $trimTitle = StringTrimRight($title, 20)
    Local $oIE = _IEAttach($trimTitle)
    _IENavigate($oIE, "http://www.explorelacrosse.com/")
EndFunc

Send("^1")
IE_Navigate_Web()

 

Share this post


Link to post
Share on other sites



If you know the URL for the desired tab, then you can use _IEAttach like this:

$myURL = "google.com"
$oIE = _IEAttach($myURL, "URL")

If that doesn't work in your situation, then you may find your answer in this thread.

Share this post


Link to post
Share on other sites

Try it like this :

 $oIE = _IEAttach("", "instance", 1)

This one attaches  to the first instance/tab.

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