When the page refreshes, most of the time the status bar displays a mixture of Waiting for..., Connectiing to ... , Read apis ... and various URLs. However, Ready is also displayed once or twice as a brief flicker before going back to Waiting for..., etc. The problem is that even the briefest flicker of Ready is often enough for StatusBarWait to fire... even though the page hasn't finished loading.
I thought I could get StatusBarWait to wait for a 'steady' Ready, i.e. when the page has really finished refreshing [and is genuinely ready] by adding an interval to StatusBarWait. However, no matter how much I play with interval and sleep, I'm not getting what I want, i.e. for the page to finish loading and display Ready (for more than just a flicker) then beep.
Am I misunderstanding the use of interval? Is there a more reliable method?
Code: Select all
MButton::
{
if WinActive("ahk_class KMeleon Browser Window") or WinActive("ahk_exe" k-meleon.exe)
SendInput, {F5}
StatusBarWait, Ready,,,,,100,,
Sleep, 200
StatusBarWait, Ready,,,,,100,,
Sleep, 100
SoundBeep
Return
}