amonaghan Posted December 10, 2016 Report Share Posted December 10, 2016 I have gone back to using an older macro which I wrote to wait for a page to load in Chrome. It used the colour changes of the 'Reload' icon near the top left of the browser. Unfortunately, it looks like Google in their infinite wisdom (sic!) have decided to change the behaviour of the reload icon. It used to only change to a darker grey before fully loading the page, then it would revert to a lighter grey/white colour. The problem is, they seem to have changed its behaviour to now change to the darker grey as soon as you hover over it (which is what my test for change looked for while loading) this change has now broken my macro as it never returns to the 'loaded' state while the mouse cursor is hovering over it. Does anyone have any suggestions? Code below. Variable Set Integer %nCheck% to 0 Get Mouse Position into (nXpos, nYpos) Relative to Current Window Mouse Move: 81, 55 Relative to Current Window Delay: 100 milliseconds Repeat Until %nCheck% Equals "1" Get Pixel Color at (82, 55) Relative to Current Window into %nPixelColour% Delay: 100 milliseconds Text Box Display: If Variable %nPixelColour% Equals "14671839" Variable Set Integer %nCheck% to 1 End If End Repeat Mouse Move: %nXpos%, %nYpos% Relative to Current Window <VARIABLE SET INTEGER Option="\x00" Destination="%nCheck%" Value="0"/> <GET MOUSE POSITION Option="\x01" X="nXpos" Y="nYpos"/> <MOUSE MOVE Option="\x02" X="81" Y="55" _PROMPT="0x000A"/> <DELAY Flags="\x02" Time="100"/> <REPEAT UNTIL Variable="%nCheck%" Condition="\x00" Value="1"/> <GET PIXEL COLOR Option="\x01" Rel_To_Screen="FALSE" X="82" Y="55" Destination="%nPixelColour%"/> <DELAY Flags="\x02" Time="100"/> <TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\f0\\fs16 %nPixelColour%\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="109" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <IF VARIABLE Variable="%nPixelColour%" Condition="\x00" Value="14671839" IgnoreCase="FALSE"/> <VARIABLE SET INTEGER Option="\x00" Destination="%nCheck%" Value="1"/> <END IF/> <END REPEAT/> <MOUSE MOVE Option="\x02" X="%nXpos%" Y="%nYpos%" _PROMPT="0x000A"/> Quote Link to comment Share on other sites More sharing options...
rberq Posted December 12, 2016 Report Share Posted December 12, 2016 The symbol at the reload location changes to an X during the reload, and back to the circular-arrow when the reload is complete. If you check the pixel location of the center of the X, it should change from black to background color when the X goes away -- that is, when the page reload is complete. It's a small target to hit with your Get Pixel Color -- might be easier to check the arrowhead because that's a little bigger. Quote Link to comment Share on other sites More sharing options...
acantor Posted December 15, 2016 Report Share Posted December 15, 2016 When hovering the mouse pointer causes a colour change, I check the pixel colour at (x, y) rather than under the pointer. Get Pixel Color at (100, 399) Relative to Current Window into %PixelColour% The challenge is determining the colour when the act of hovering causes the colour to change. My workaround: take a screenshot, paste the screenshot into Paint, and use MEP's Mouse Locator tool to check the colour in Paint. Quote Link to comment Share on other sites More sharing options...
amonaghan Posted December 15, 2016 Author Report Share Posted December 15, 2016 Thanks Alan, I like that suggestion and hope to find time at the weekend to try it. Quote Link to comment Share on other sites More sharing options...
Cory Posted December 23, 2016 Report Share Posted December 23, 2016 Why don't you just get the pixel color at the location and leave the cursor someplace else? Also what are you doing? I might be able to offer some tools to download pages for you as an external script and avoid all this. 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.