How do I wait for Google Chrome to load a webpage before continuing in AutoHotkey?

后端 未结 6 792
南方客
南方客 2020-12-10 12:30

I am working on a AutoHotkey script that does a repetitive job in Google Chrome. Every time that I click a link from the script, I have to tell my script to sleep while the

6条回答
  •  有刺的猬
    2020-12-10 12:49

    The following script can be used to get the color at (x, y) on the loaded page

    !q::
        x := 100
        y := 200
        msgbox, start
        mousemove, x, y
        PixelGetColor, pColor, x, y, RGB
        Msgbox, Pixel color %pcolor% at %x% %y%
    return
    

    The following script can be used to wait until the page gets loaded

    !z::
        x := 100
        y := 200
        loop
             { 
             sleep, 500
             PixelGetColor, pColor, x, y, RGB
             If (pColor = "0x4285F4")
                {
                msgbox, found color: %pcolor%
                break
                }
             }
        ;The next script comes here
        send, {enter}
        ;...
    return
    

    Reference: https://www.autohotkey.com/boards/viewtopic.php?t=65554

提交回复
热议问题