Jump to content
Macro Express Forums

Wait For (web)frame?


sdspieg

Recommended Posts

Is there any way to make a macro wait until a frame has loaded on a webpage? I tried with the 'wait for web'page' (without a name - because it's a java-based page and the name of the webpage itself doesn't change), also with a delay as suggested on this board, but the macro doesn't 'get' it...

Here's what I try to do - I have to fill in some fields on a webform, then click on enter (and all of this works fine); but then I have to wait until that request is fulfilled until I repeat the macro, and the timing on that one is extremely erratic.

Any ideas? Thanks

 

-Stephan

Link to comment
Share on other sites

OK, let's use http://www.macros.com/ as our example.

 

If you open this URL, you can see a small box containing the word "RSS" on the left-hand side underneath the word "Search". On my computer this box is orange, with a pixel colour of 26367 (it'll probably be different for you) and this colour is located at position 58, 562 under Active Window using the Mouse Locator tool (again, this will be different for you). But the essential point to realize (or at least hope for) is that this box is always at the same location, and always this colour (if Kevin reads this, he'll probably ask his web designer to change this immediately <g>!).

 

So you write a script along these lines:

Web Site: http://www.macros.com [Default Browser]

Repeat Start (Repeat 10 times)

Get Pixel: Window Coords: 58,562 into %N1%

If Variable %N1% = 26367

Repeat Exit

End If

Wait Time Delay 1 Seconds

Repeat End

 

This opens the desired URL, then enters a loop for a maximum of 10 seconds to check the pixel colour at the specific location. When it equals our colour, then we assume the page is loaded and we exit the loop. At the end of 10 seconds, the loop terminates. If you check the value of %N1% after the loop has finished, it will equal our colour of 26367 if the page loaded successfully, and some other value if the page didn't load (or Kevin had the colour and/or location changed!).

 

I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...