Ideas are below.
Code: Select all
#Requires AutoHotkey v2.0
list := []
running := False
F1:: {
list.Push(A_Clipboard)
SoundBeep 2500
If list.Length > 1 && !running {
SetTimer do, 3000
Global running := True
ToolTip 'Running'
}
}
do() {
Send list.RemoveAt(1)
If list.Length < 2 {
SetTimer do, 0
Global running := False
ToolTip
}
}
Concepts:
1. To enable a timer, use a frequency greater than zero.
2. A loop can be used in a timed routine, but if the idea is to execute code at a timed frequency, then
Loop is omitted because
SetTimer creates a timed loop.
3. AHK does not directly provide a way to know whether a timer is running, but you can use a variable to track that information.
4. The documentation can help you learn more about how to use SetTimer. See the
examples.
5.
> means "greater than", rather than "greater than or equal to". Change the operators if needed. The documentation provides a complete listing of valid operators.