Sign in to follow this  
Followers 0
Biggs

Flipping between IE7 tabs

8 posts in this topic

Howdy All,

I am really new to Autoit but have 30+ years of programming experience.

I recently was give a task to create a "dashboard" for 4 monitored functions that are accessed via Web browser. Call them F1 to F4. each has its own URL. The information on the page is dynamic data that changes every 15 minutes. Every 15 minutes each page updates. This can take up to 30 seconds and is controlled by the application, not by IE.

I have created a script that Loads the 4 url in 1 IE7 instance having 4 Tabs using the IECREATE and NAVAGATE2 functions. I want to add to that script.

What I would like to do is do a forever loop to:

Display tab 1 URL F1

wait 30 seconds

Display tab 2 URL F2

wait 30 seconds

Display tab 3 URL F3

wait 30 seconds

Display tab 4 URL F4

wait 30 seconds

This loop would repeat until the script is manually canceled.

Can anyone help me out with how to do this loop? What i really need is to know how to skip the tab I want. I thought I could use the IEATTACH but that did not seem to work Maybe I am doing it wrong.

Please help if you can.

Thanks

Bill

Share this post


Link to post
Share on other sites



First off, welcome to the forums!

Two thoughts:

1. Why not just open a separate IE window (instead of a tab) and just cycle through them using WinActivate?

2. IE is extremely fickle about allowing access programatically to the tabs interface, as in it doesn't really make it accessible. If you want to stick with the tabbed-interface you'll have to probably resort to using WinActivate, WinWaitActive, and ControlSend, like this:

#include <IE.au3>

WinActivate ("Google - Windows Internet Explorer")
WinWaitActive("Google - Windows Internet Explorer")
ControlSend ("Google - Windows Internet Explorer", "", "",  "^{Tab}")

Share this post


Link to post
Share on other sites

That sounds like a possibility.

As I said I am a real rookie on this language. I have questions about the WinActivate is that of the title and text is uses. On these 4 IE windows, the title is the same. So I can determine the four i need that way by title. The text is from the contents of the window? And to make sure I get the window I want I have to have a unique text in that window?

Sorry for being a bit of a pest on this, but the documentation is less than clear.

Bill

First off, welcome to the forums!

Two thoughts:

1. Why not just open a separate IE window (instead of a tab) and just cycle through them using WinActivate?

2. IE is extremely fickle about allowing access programatically to the tabs interface, as in it doesn't really make it accessible. If you want to stick with the tabbed-interface you'll have to probably resort to using WinActivate, WinWaitActive, and ControlSend, like this:

#include <IE.au3>

WinActivate ("Google - Windows Internet Explorer")
WinWaitActive("Google - Windows Internet Explorer")
ControlSend ("Google - Windows Internet Explorer", "", "",  "^{Tab}")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That sounds like a possibility.

As I said I am a real rookie on this language. I have questions about the WinActivate is that of the title and text is uses. On these 4 IE windows, the title is the same. So I can determine the four i need that way by title. The text is from the contents of the window? And to make sure I get the window I want I have to have a unique text in that window?

Sorry for being a bit of a pest on this, but the documentation is less than clear.

Bill

It's all good, we all started out there. ;)

Here's an example of how you can open your windows and then get a reference to them that will be unique (even if the Title/Text is the same on all of them):

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")
$vHWND = _IEPropertyGet($oIE, "hwnd")

WinSetState ($vHWND, "", @SW_HIDE)
Sleep (5000)
WinSetState ($vHWND, "", @SW_SHOW)
Edited by exodius

Share this post


Link to post
Share on other sites

That works Great!!!

I have it so that it creates and then hides each IE window. Then cycles through the windows displaying each for 1 minute (6000 ms).

The only thing I need now is to have it create each window in the exact same spot, right now there is an offset of like 50 on each new window. is that controllable with in the script or is it a windows function?

Again, Many thanks for your help.

Respectfully

Bill

It's all good, we all started out there. ;)

Here's an example of how you can open your windows and then get a reference to them that will be unique (even if the Title/Text is the same on all of them):

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")
$vHWND = _IEPropertyGet($oIE, "hwnd")

WinSetState ($vHWND, "", @SW_HIDE)
Sleep (5000)
WinSetState ($vHWND, "", @SW_SHOW)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

It sure is, look into WinMove, and use it the same way you use the other Win* functions. ;)

Also, take a look at the Au3Info tool (In SciTE go up to Tools --> Au3Info) for getting screen coordinates of windows.

Edited by exodius

Share this post


Link to post
Share on other sites

actually I discovered the _IEPropertySet command and am using it to place them where I want them and re-size them so they fit better. I have these 52 inch HDTV/Displays that are in a public area and each is to be split in the quadrants for a total of 8 areas. The Windows in this loop routine is only one of the eight. Anyways with this command I can put them exactly where I want them and remove all the bars from the window. It is working good.

The only thing I have not figured out is how to end the loop gracefully. I was thinking of the IsPressed function and pressing and holding the END key during a sleep, but am not sure if that key press would register.....

Anyways, Thanks for all your help.

Bill

Share this post


Link to post
Share on other sites

Look into HotKeySet fella ;)

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