Tapping ctrl twice quickly clears the copy queue.
The wav files came from https://evolution.voxeo.com/library/audio/prompts/numbers/index.jsp and I didn't use Windows' internal voice because audio outputs are tricky on my Windows running in OSX BootCamp and it didn't work.
So -- I've heard that if you submit inefficient code, suggestions and fixes will come quickly.
(and there are many inefficiencies)
#1 I want to address is... would writing to an ini file bring any speed or reliability gains?
#2 Could I generate the ctrl-1 through ctrl-9 hotkeys through a single formula (like currying?)
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^+c::
Send ^c
sleep 250
clipboard = %clipboard%
FileAppend, %clipboard%###, clipboard_queued.txt
sleep 100
FileRead, text, clipboard_queued.txt
copyArr := StrSplit(text, "###")
SoundPlay, % copyArr.Count() -1 ".wav"
return
~Ctrl::
;double-tap control key to clear your queue
if (A_PriorHotKey = "~Ctrl" AND A_TimeSincePriorHotkey < 200)
{
FileDelete clipboard_queued.txt
SoundPlay, 0.wav
}
Sleep 0
KeyWait Ctrl
return
^Numpad0::
FileDelete clipboard_queued.txt
SoundPlay, 0.wav
return
^Numpad1::
^1::
clipboard := copyArr[1]
sleep 150
Send ^v
if (copyArr[1]) {
SoundPlay, 1.wav
} else {
SoundPlay, 0.wav
}
return
^Numpad2::
^2::
clipboard := copyArr[2]
sleep 150
Send ^v
if (copyArr[2]) {
SoundPlay, 2.wav
} else {
SoundPlay, 0.wav
}
return
^Numpad3::
^3::
clipboard := copyArr[3]
sleep 150
Send ^v
SoundPlay, 3.wav
return
^Numpad4::
clipboard := copyArr[4]
sleep 150
Send ^v
SoundPlay, 4.wav
return
^Numpad5::
clipboard := copyArr[5]
sleep 150
Send ^v
SoundPlay, 5.wav
return
^Numpad6::
clipboard := copyArr[6]
sleep 150
Send ^v
SoundPlay, 6.wav
return
^Numpad7::
clipboard := copyArr[7]
sleep 150
Send ^v
SoundPlay, 7.wav
return
^Numpad8::
clipboard := copyArr[8]
sleep 150
Send ^v
SoundPlay, 8.wav
return
^Numpad9::
clipboard := copyArr[9]
sleep 150
Send ^v
SoundPlay, 9.wav
return