Solved

Script to Auto Refresh IE7 with multiple Tabs open

Posted on 2010-11-16
4
2,389 Views
Last Modified: 2012-05-10
SITUATION:

I have several WYSE thin clients accessing a proficy historian server that runs reports (Via a web interface)....On the Clients, I have several pages that load in different tabs, in which i currently have a script that runs to send "CNTRL+TAB" keys to toggle thrrough the tabs in IE7.

MY PROBLEM
My problem is, often the pages expire or for some reason, display errors in which hitting "F5" to refresh the page, fixes the problem....is there a VBS script I can stick in the "startup" folder to kick off (along with the IE page that loads all of the tabs) to ensure every 2 minutes that the page can be automatically refreshed? I've used one already, but only seems to work with just 1 page. Guess I just need scripting help here. Thanks!!

ULTIMATE GOAL:
Here's the script I have ..but need to work it so I can include other "tabs" within the same IE7 page:  (script from: http://blogs.technet.com/b/heyscriptingguy/archive/2005/09/27/how-can-i-periodically-refresh-a-web-page.aspx )




On Error Resume Next
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "http://www.microsoft.com/technet/scriptcenter"   
objExplorer.Visible = 1
Wscript.Sleep 5000
Set objDoc = objExplorer.Document
Do While True
    Wscript.Sleep 30000
    objDoc.Location.Reload(True)
    If Err <> 0 Then
        Wscript.Quit
    End If
Loop


Thanks in Advance!!!
0
Comment
Question by:CSTAR05
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
asurianu earned 125 total points
ID: 34289787
Hi
instead of that you can make it such a way that web pages automatically refresh after certain time.
Here is a EE discussion thread on the same
http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_20860398.html
0
 
LVL 14

Expert Comment

by:Psy053
ID: 34496775
You've mentioned that you have a script that changes the tabs using SendKeys, why don't you modify that script so that it also sends F5
0
 
LVL 14

Expert Comment

by:Psy053
ID: 34497109
I thought I would write up an example for you that should do most things you are after.

The attached VBScript will open up three tabs and then cycle through them (using SendKeys to send CTRL TAB), once the script has cycled through the tabs a pre-determined number of times, the script will then refresh each tab (using SendKeys to send F5), the script will then loop through the Cycle and Reload sections.

There are some settings you can change with the script, these are at the top and are commented.
 
One thing to be aware of though, is that if the Focus is removed or stolen from the Internet Explorer window, the Script will cease to function correctly - however, the SendKeys events will continue to be sent to whatever has focus. I will have a look around and see if I can find a fix for this, however, to my knowledge, there isn't a way to detect whether Internet Explorer still has focus or not.

In order to stop the Script, you will need to close the Internet Explorer window that the Script opened.

Cycle-And-Reload.txt
0
 
LVL 3

Expert Comment

by:sam0x01
ID: 34969907
Looks like the object model of Internet Explorer through vbScript does not handle Tabs other than through SendKeys. This sample above will not be transparent to the user, it will toggle the tabs and refresh the page on each tab. It may be possible through the .NET Framework which could be accessed through Powershell (just not vbScript).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question