Clipboard working but ClipboardAll not working?
Posted: 21 Feb 2019, 04:06
Hi, I'm working on a hotkey that swaps the current clipboard with the prior one. This is handy for swapping words in a text with two clicks, for example, to swap the words "hello" and "autohotkey" in the following string: "hello world autohotkey" >> "autohotkey world hello".
Here is my script, but for some reason it's not working. However it works if I replace ClipboardAll with Clipboard:
TBH I've always found ClipboardAll to act funny. I'm hoping to finally come to terms with it, thanks in advance! 
Here is my script, but for some reason it's not working. However it works if I replace ClipboardAll with Clipboard:
Code: Select all
LButton & c::
PriorClipboard() ;Save clipboard first
SendInput, ^c
Return
LButton & r:: ;restore prior clipboard
Clipboard := PriorClipboard()
Return
PriorClipboard()
{
Static ClipPrior := "(prior clipboard was empty)"
Temp := ClipPrior
ClipPrior := ClipboardAll ;Changing this to just "Clipboard" works, why?
Return Temp
}
