OK, finally figured it out I think. Here is my little innovation. Copy a comma or linefeed-separated list of items and they will be copied as separate clipboard entries by pressing Ctrl-Alt-3 and Ctrl-Alt-4. You may change the hotkeys to suit yourself of course. I also use Ctrl-Alt-mousewheel to roll forward and backward through the entries.
Code:
#SingleInstance force
#Persistent
Setkeydelay,1,1
;Pajenn's clipboard
Gosub,Msg
SendMode Input
handleClip("clear")
^!1::handleClip("clear")
^!2::handleClip("get")
^!WheelUp::handleClip("roll")
^!WheelDown::handleClip("rollforward")
^!3::Gosub,DuranDuran
^!4::Gosub,Bing
~^x::
~^c::
ClipWait, 2
Sleep, 50
handleClip("save")
return
handleClip(action)
{
static
if (action = "save")
{
AddNextNum:= AddNextNum < 30 ? AddNextNum+1 : 1
HighestNum+= HighestNum < 30 ? 1 : 0
GetNextNum:= AddNextNum , ClipArray%AddNextNum% := Clipboard
}
else if ((action = "get") || (action = "roll")) && (GetNextNum != 0)
{
if (action = "roll")
Send ^z
Clipboard := ClipArray%GetNextNum%
GetNextNum:= GetNextNum > 1 ? GetNextNum-1 : HighestNum
Send ^v
}
else if ((action = "rollforward") && (GetNextNum != 0))
{
Send, ^z
GetNextNum:= GetNextNum < HighestNum ? GetNextNum+1 : 1
Clipboard:= ClipArray%GetNextNum%
Send, ^v
}
else if (action = "clear")
GetNextNum:=0, AddNextNum=HighestNum=0
else if (action = "write")
loop, 15
{
If A_Index = 1
FileAppend, `n%A_Now%`n, %A_ScriptDir%\ClipRing.txt
If content:= ClipArray%A_Index%
FileAppend, %content%`n, %A_ScriptDir%\ClipRing.txt
}
}
DuranDuran:
ClipBoard =
Send,^c
Clipwait,1
Fonda = %ClipBoard%
Loop,Parse,Fonda, `n, `r
{
Autotrim,On
If A_LoopField =
Continue
If A_LoopField = %A_Tab%
Continue
Else
Clipboard = %A_LoopField%
handleClip("save")
Msgbox,,,Item added %A_LoopField%,.2
}
Return
Bing:
ClipBoard =
Send,^c
Clipwait,1
Fonda = %ClipBoard%
Loop,Parse,Fonda,`,
{
Autotrim,On
If Clipboard =
Continue
Clipboard = %A_LoopField%
handleClip("save")
Msgbox,,,Item added %A_LoopField%,.2
}
Return
;-------------------------------
^+Insert::Suspend
^!Escape::Exitapp