nuggles Posted February 1, 2009 Report Share Posted February 1, 2009 hello once again. So a little while back i saw mention of a workaround for the Wait for Web Page function, that is only offered for IE. I believe they were mentioning something about having ME monitor the "spinning" circle in the top right of the FF window when it loads a page. I believe it was something about the change in colors or something. If anyone has successfully implemented the workaround, using the aforementioned method or not, i would greatly appreciate it. Quote Link to comment Share on other sites More sharing options...
acantor Posted February 2, 2009 Report Share Posted February 2, 2009 hello once again. So a little while back i saw mention of a workaround for the Wait for Web Page function, that is only offered for IE. I believe they were mentioning something about having ME monitor the "spinning" circle in the top right of the FF window when it loads a page. I believe it was something about the change in colors or something. If anyone has successfully implemented the workaround, using the aforementioned method or not, i would greatly appreciate it. Another way to do this is to monitor the shape of the mouse cursor. That is what I do in one macro I wrote to automatically log on to my hotmail account via Firefox. It involved moving the cursor to a "neutral" location where the cursor shape is less likely to inadvertently change to an unexpected shape. Part of the script ended up looking like this: Mouse Move: 4, 4 Relative to Current Window Wait for Not Mouse Cursor: App Start Wait for Mouse Cursor: Arrow Wait for Not Mouse Cursor: App Start Wait for Mouse Cursor: Arrow Wait for Not Mouse Cursor: App Start Wait for Mouse Cursor: Arrow There are problems with all approaches. One issue with web pages appears to be that a page may not be fully loaded until after any Javascript is done running. To make my macro work reliably, I needed to insert strategic delays. And even then, it's not 100% reliable... but I would guess it works 18 or 19 times out of 20. Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 2, 2009 Report Share Posted February 2, 2009 hello once again. So a little while back i saw mention of a workaround for the Wait for Web Page function, that is only offered for IE. I believe they were mentioning something about having ME monitor the "spinning" circle in the top right of the FF window when it loads a page. I believe it was something about the change in colors or something. If anyone has successfully implemented the workaround, using the aforementioned method or not, i would greatly appreciate it. I was hoping ME Pro would add the facility for Firefox, but disappointingly it didn't. So I wrote this simple work-around a couple of weeks ago and it seems to be reliable. It just looks at the 'X' icon top left of the toolbar ('Stop loading this page'), which changes from red to grey when the page has finished loading. Obviously, the pixel position co-ordinates will differ for individual users. The macro is called Wait for FF web page ready. Delay: 500 milliseconds, without ability to halt Repeat Until %StopColour% Equals "10264995" Get Pixel Color at (112, 60) Relative to Current Window into StopColour Delay: 50 milliseconds, without ability to halt End Repeat Macro Return <DELAY Flags="\x03" Time="500"/> <REPEAT UNTIL Variable="%StopColour%" Condition="\x00" Value="10264995"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="112" Y="60" Destination="StopColour"/> <DELAY Flags="\x03" Time="50"/> <END REPEAT/> <MACRO RETURN/> I just add it as a Macro Run command after the Web Site command, like this: Web Site, "http://services.dial.pipex.com/eweb/", using Default Web Browser Macro Run: Wait for FF web page ready etc -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
nuggles Posted February 10, 2009 Author Report Share Posted February 10, 2009 hi terry, thanks for the info, though when i copyed your script into the direct editor i got the following message: "The variable StopColour is not currently defined. Would you like to create it now?" it then takes me to a "variable properties" window, and i do not know what options to select.. thanks for your help I was hoping ME Pro would add the facility for Firefox, but disappointingly it didn't. So I wrote this simple work-around a couple of weeks ago and it seems to be reliable. It just looks at the 'X' icon top left of the toolbar ('Stop loading this page'), which changes from red to grey when the page has finished loading. Obviously, the pixel position co-ordinates will differ for individual users. The macro is called Wait for FF web page ready. Delay: 500 milliseconds, without ability to halt Repeat Until %StopColour% Equals "10264995" Get Pixel Color at (112, 60) Relative to Current Window into StopColour Delay: 50 milliseconds, without ability to halt End Repeat Macro Return <DELAY Flags="\x03" Time="500"/> <REPEAT UNTIL Variable="%StopColour%" Condition="\x00" Value="10264995"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="112" Y="60" Destination="StopColour"/> <DELAY Flags="\x03" Time="50"/> <END REPEAT/> <MACRO RETURN/> I just add it as a Macro Run command after the Web Site command, like this: Web Site, "http://services.dial.pipex.com/eweb/", using Default Web Browser Macro Run: Wait for FF web page ready etc -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 10, 2009 Report Share Posted February 10, 2009 hi terry, thanks for the info, though when i copyed your script into the direct editor i got the following message: "The variable StopColour is not currently defined. Would you like to create it now?" it then takes me to a "variable properties" window, and i do not know what options to select.. thanks for your help I chose StopColour because it reminds me later what it's about, but it does take a couple of seconds extra to define. But you can just use N[1] instead then. I'm assuming you do know the basics of how to use variables? If not then you have some basic reading to do! Meanwhile, to get it working you can respond to that message you mentioned as follows: Choose Integer Variables from the Variable Type drop down list. Type the name, e.g. StopColour if it's not already present. Leave the other two boxes as they stand for now. Click OK and that's it. You can now use that variable in your commands. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
nuggles Posted February 10, 2009 Author Report Share Posted February 10, 2009 Thanks Terry, Must admit, I do have some basic reading to do I therefore searched the Help section before posting this, but could not find an answer to the following: I am using FF 3.0.5. The X changes from blue to grey in this version, so I assume you wrote your script for another FF version or possibly have modified your toolbar (though i doubt it). I have modified the pixel position to reflect my particular window. I do not know how to sample the color from the exact pixel position i've chosen. As a result the wait for page macro just stagnates, apparently waiting for a change to your defined gray color it never sees. Do you know how i can get the color of the pixel at the pixel position i selected? Thanks, and sorry if this is elementary, but I did attempt a help search and came up empty Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 10, 2009 Report Share Posted February 10, 2009 Thanks Terry, Must admit, I do have some basic reading to do I searched the Help, but could not find an answer to the following: I am using FF 3.0.5. The X changes from blue to grey in this version, so I assume you wrote your script for another FF version or possibly have modified your toolbar (though i doubt it). I have modified the pixel position to reflect my particular window. I do not know how to sample the color from the exact pixel position i've chosen. As a result the wait for page macro just stagnates, apparently waiting for a change to your defined gray color it never sees. Do you know how i can get the color of the pixel at the pixel position i selected? Thanks, and sorry if this is elementary, but I did attempt a help search and came up empty Open the macro in Script Editor, d-click the Get Pixel command and click the Launch Mouse Locator button. The box that then appears will show you Pixel Colour as an 8-digit integer at the bottom. I have FF 3.0.6 but I'm positive my Stop icon has been red for ages, if not forever, so I'm surprised yours is blue. But of course that has no effect on the macro, which merely looks for that particular grey. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
nuggles Posted February 10, 2009 Author Report Share Posted February 10, 2009 I was just about to delete my previous reply, as I did in fact find the Launch Mouse Locator. I identified a pixel in the "X", and copied over the pixel position and pixel color as an 8-digit integer. My macro now works flawlessy. Terry, once again, I thank you. You seem to be quite a bit of help around here Tal Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 10, 2009 Report Share Posted February 10, 2009 Pleased to hear you're sorted. I'm happily using that routine in many of my macros and so far it's proved very reliable. Re that red versus blue Stop icon. I hate unsolved puzzles, so ... have you possibly customised your theme? I always stick to defaults, and haven't so far come across anyone else with a blue icon. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
terrypin Posted February 10, 2009 Report Share Posted February 10, 2009 Pleased to hear you're sorted. I'm happily using that routine in many of my macros and so far it's proved very reliable. Re that red versus blue Stop icon. I hate unsolved puzzles, so ... have you possibly customised your theme? I always stick to defaults, and haven't so far come across anyone else with a blue icon. -- Terry, East Grinstead, UK Puzzle solved I think! I bet you're using Vista, whereas I have XP Pro. -- Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
DavidJT Posted July 8, 2009 Report Share Posted July 8, 2009 I have upgraded to Firefox 3.5 and the following is the code that seems to work pretty consistent for me: <DELAY Flags="\x02" Time="500"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="139" Y="70" Destination="%StopColor%"/> <REPEAT UNTIL Variable="%StopColor%" Condition="\x01" Value="197042"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="139" Y="70" Destination="%StopColor%"/> <END REPEAT/> <MACRO RETURN/> I'm basing the code off an assumption that the X is either going to be red (197042) or gray. As long as it is red, I'll wait. I haven't had any hangups in the three days that I have been using now. Quote Link to comment Share on other sites More sharing options...
paul Posted July 8, 2009 Report Share Posted July 8, 2009 I too use the approach of checking the colour of the X in Firefox. But do be warned that this is not 100% reliable. I have one site I visit most days for which I have written a script to take me to the page I need to be on, involving passing through 4 other pages first. 2 of these pages work simply by checking the X, one page requires an additional 1 second delay, and one page requires a delay of anything from 0 to 5 seconds. In other words, the X indicates that this last page has loaded, but I must wait longer until I can actually navigate in it - and there's absolutely no visible indication of any change during the wait. It's a mystery to me, but my script works reliably 99% of the time. It's always the 1st visit after I have loaded Firefox that is unreliable (I keep Firefox loaded in memory using Actual Window Minimizer). Quote Link to comment Share on other sites More sharing options...
nuggles Posted October 1, 2009 Author Report Share Posted October 1, 2009 thanks a lot David, that works great Quote Link to comment Share on other sites More sharing options...
paul Posted October 2, 2009 Report Share Posted October 2, 2009 Just a caveat here. I use the same approach of checking the colour of that X. I often attach to a remote MySql database via a web page, and need to select the database, open the SQL tab, run a dummy query, edit it, and close the results window before I'm able to use the facility. So, of course, my macro goes through all these preliminary steps for me. But opening the SQL tab does not work unless I wait several seconds after that X becomes grey, even though there's no visible on-screen indication of anything changing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.