FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites  * Code Snippets
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


auto refresh for ie

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Beginners
View previous topic :: View next topic  
Author Message
theonex
Newbie


Joined: 10 May 2012
Posts: 16

Reputation: 100

PostPosted: Thu May 10, 2012 12:41 pm    Post subject: auto refresh for ie Reply with quote

hello

I would appreciate any help or suggestions on this topic I have couple of scripts running without any problems however I have a problem with the loading of websites sometimes and a simple refresh fixes this issue for me. I was wondering if itís possible to write a little script that will run on a loop monitoring ie explorer and if ie explorer status stays busy lets say for 10 seconds will send a refresh command.

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Marcus Tettmar
Site Admin


Joined: 19 Sep 2002
Posts: 5639
Location: Dorset, UK
Reputation: 1391
votes: 58

PostPosted: Wed May 16, 2012 9:55 am    Post subject: Reply with quote

The "best" approach would be to use some VBScript to monitor IE's busy property, create a loop with a timeout and then call IE's refresh function. Search these forums for "internetexplorer.application". Ideally you'd need the script to create the IE instance, although it is possible to "GET" an existing IE instance. There's code on this forum to do this.

If you're not comfortable with that you could in theory use the screen text capture functions to monitor the text of IE's status bar, in a loop, use the Timer function to monitor elapsed time at the same time and if needed, send F5 to IE.
_________________
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website Facebook ID
theonex
Newbie


Joined: 10 May 2012
Posts: 16

Reputation: 100

PostPosted: Thu May 17, 2012 11:11 pm    Post subject: Reply with quote

hi mtettmar

thanks for your reply and suggestion i am not so good with VBscripts. by any chance could you write a small script monitoring IE busy and how to creat a loop with timeout. i would really appreciate your help

thank you

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Marcus Tettmar
Site Admin


Joined: 19 Sep 2002
Posts: 5639
Location: Dorset, UK
Reputation: 1391
votes: 58

PostPosted: Fri May 18, 2012 11:14 am    Post subject: Reply with quote

Right, good job I'm not too busy today eh? Here's one solution:



Comments should explain it.

So first thing we do is "attach" to the given IE window so that we can "hook" into it. Then we have a function which will wait for IE to cease being busy by looking at IE's busy property OR a given millisecod timeout, whichever comes first. This function returns true if IE stopped being busy before the timeout occurs, false if the timeout occurs first.

So in our main script we set up a loop which continually monitors IE by running this WaitWithTimeout, set for a 10 second timeout. And if the timeout occurs (IE has been busy for 10 seconds) then we issue a refresh.
_________________
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message Visit poster's website Facebook ID
theonex
Newbie


Joined: 10 May 2012
Posts: 16

Reputation: 100

PostPosted: Fri May 18, 2012 7:24 pm    Post subject: Reply with quote

thank you sooooooo much mtettmar i really appreciate that.. i hope this will also be useful to others out there

many thanks again

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Beginners All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group