paulja

Refresh inactive IE window

3 posts in this topic

Disclaimer: I am a complete tyro with scripting, and I don't know if what I'm asking is so simple that no one's needed to ask it, or so out of scope that no one would think to ask it. In any case, I don't see this asked before.

 

At my job, there's a web-based system we use Internet Explorer for. On the last update it added a security "feature" where it logs you out after ten minutes of inactivity. Well, there are times when we don't need to work on the system but we want to hop back in when we need to. So I want to write a script to give it a refresh every 9 minutes and 45 seconds or so, but I don't want it to have the window pop up on me and kick me out of Word or Excel or whatever. I tried:

 

AutoItSetOption("WinTitleMatchMode",2)

ControlSend("Internet Explorer","","Internet Explorer","{F5}")

 

And it appears I have two problems. First, even if I activate the window beforehand, IE doesn't recognize the F5 as a command to refresh, or indeed any keystrokes sent by ControlSend. This appears to be specific to IE, as I can do it with Notepad and have it enter text. Second, even with Notepad, it doesn't work when the window is inactive. I can't have it "ghost write" any text on an inactive Notepad window.

 

So, is there any way to send a surreptitious refresh command to an IE window? 

Share this post


Link to post
Share on other sites



Hi, @paulja, welcome to the forum. Take a look at the IE functions in the help file. I would suggest looking at _IEAttach to attach to the existing window, and then look at _IEAction, as there is a command for "refresh". Read through both sections in the help file, and try out the examples for yourself. Then try it on your current window; if you run into problems post your code back here and we'll do our best to assist ;)

 


√-1 2^3 ∑ π, and it was delicious!

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