How do I suspend macro until web page completely loads?
Moderators: JRL, Dorian (MJT support)
How do I suspend macro until web page completely loads?
I want to open an arbitrary web page from a link and have the macro suspended until the new web page completely finishes loading up.
I just cant seem to figure it out. It shoudl be something so simple. like a simple waitready> command that just suspends the script until the window completely loads.
Im doing this because i don't want to use a timeout. I want my macro to run as fast as possible and since the loading time of web pages varies, then i would be waisting time if i used a long timeout while crashing the macro with too low of a timeout.
Thank you.
Max.
I just cant seem to figure it out. It shoudl be something so simple. like a simple waitready> command that just suspends the script until the window completely loads.
Im doing this because i don't want to use a timeout. I want my macro to run as fast as possible and since the loading time of web pages varies, then i would be waisting time if i used a long timeout while crashing the macro with too low of a timeout.
Thank you.
Max.
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
The only good way is to use IE's own busy function. Details in this thread
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
And Firefox?
A couple of things. First, is there anything that can be done with firefox to force it to wait until the pressed link, not a newly launched firefox window, fully loads the page. (if way too complicated, then never mind)
And two, this process of waiting for a link to fully loadup and setting a timeout seems to be a common routine. Are you guys going to be implementing a simple approach to this problem in future revisions of your Macro Scheduler?
Wouldn't it be sweet if it can be as simple as this:
waitloadcomplete>url,result
timeout>5 sec
if>result=1(page loaded)
then...
else
endif
Thank you.
And two, this process of waiting for a link to fully loadup and setting a timeout seems to be a common routine. Are you guys going to be implementing a simple approach to this problem in future revisions of your Macro Scheduler?
Wouldn't it be sweet if it can be as simple as this:
waitloadcomplete>url,result
timeout>5 sec
if>result=1(page loaded)
then...
else
endif
Thank you.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
FireFox doesn't provide the same kind of interface as IE, so, no, there's no alternative for FF. For web site automation it is best to use IE.
To automate IE either use the VBscript samples linked above, or the WebRecorder IEAuto library.
FireFox doesn't provide the same kind of interface as IE, so, no, there's no alternative for FF. For web site automation it is best to use IE.
To automate IE either use the VBscript samples linked above, or the WebRecorder IEAuto library.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
There is a way to do this if you have control of the computer that's waiting for Firefox. The technique mentioned here could be employed.
Basically, if the Firefox Navigation Toolbar is turned on there is an icon that is a stop sign with a white "X" in it. Mine is located 145 pixels to the right of the upper left corner of the Firefox window and 65 pixels down from the same corner. While the web page is loading that icon is red, (color 3573) when the web page has finished loading, the color changes to grey (color 11711927)
Simply check the pixel color of that icon location after you start your download. When the pixel color is grey, the download is complete.
Hope this helps,
Dick
Basically, if the Firefox Navigation Toolbar is turned on there is an icon that is a stop sign with a white "X" in it. Mine is located 145 pixels to the right of the upper left corner of the Firefox window and 65 pixels down from the same corner. While the web page is loading that icon is red, (color 3573) when the web page has finished loading, the color changes to grey (color 11711927)
Simply check the pixel color of that icon location after you start your download. When the pixel color is grey, the download is complete.
Hope this helps,
Dick
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I have an old script somewhere that I used to do that for Netscape. Don't have access right now, but I seem to recall that I looped on one of the Main Menu options that would not be available until the page was fully loaded. Once the menu option worked I would know the page was loaded and jump out of the loop.
I suspect the same method would work for Firefox. Perhaps someone else will know which Main Menu options are not available until fully loaded.
I suspect the same method would work for Firefox. Perhaps someone else will know which Main Menu options are not available until fully loaded.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Good idea - or use the image recognition library to wait while the stop button is present.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
There's always a way isn't there.
It just takes overservation and creativity.
I was looking for a cue or something that would reveal if the page has completed loading. But i just couldn't find it.
Thanks a bunch guys.
Max
PS>Im using a trial version of your latest version of Macro Scheduler, and i would like to tell you (the administrator) that it would be handy if all lines of codes were had letters automatically capitalized.
Another words: if i type press c, it would be nice if Macro Scheduler automatically changed it to Press c.
It just takes overservation and creativity.
I was looking for a cue or something that would reveal if the page has completed loading. But i just couldn't find it.
Thanks a bunch guys.
Max
PS>Im using a trial version of your latest version of Macro Scheduler, and i would like to tell you (the administrator) that it would be handy if all lines of codes were had letters automatically capitalized.
Another words: if i type press c, it would be nice if Macro Scheduler automatically changed it to Press c.