I have been working on a little AHK script to give myself a larger clipboard when copy-pasting. So far I have the following:
global bigboard := {}
^+c::copyToClipboard()
^+v::pasteFromClipboard()
copyToClipboard() {
Input, num, L1 T10
if (ErrorLevel = Timeout or RegExMatch(num, "[0-9]") = 0) {
return
}
oldC := ClipboardAll
Send, ^c
bigboard[num] := ClipboardAll
Clipboard := oldC
oldC =
return
}
pasteFromClipboard() {
Input, num, L1 T10
if (ErrorLevel = Timeout or RegExMatch(num, "[0-9]") = 0) {
return
}
oldC := ClipboardAll
Clipboard := bigboard[num]
Send, ^v
Clipboard := oldC
oldC =
return
}
Yes, there's some repeated code here and it could certainly be a lot more organized, but this isn't exactly enterprise stuff. Anyways, this isn't working. After a good deal of debugging, It seems that the script properly copies data when given valid input [ctrl+shift+c followed by any number], but when I try to paste it back out it simply does nothing. On top of that, the clipboard contents are properly stored and restored between uses of the copy-paste functionality, so it's apparently nothing to do with the clipboard interaction, just something about how I'm using the object to store data. I have also tried using
bigboard[%num%]
in case it needed the value from num, but that didn't work either. Any help would be appreciated.