StatusBarWait for 'steady' Ready

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

StatusBarWait for 'steady' Ready

15 Jan 2018, 12:43

I'm using a Mozilla-based browser and trying to detect when the current page has really finished refreshing. I'm using StatusBarWait to look for Ready and it works very well for what I want... but only ~50% of the time.

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
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 244 guests