I Have it Set to the Last 5 Items But you can set it to as many as 9
Timer Clears Var sos12 and the context menu after 5 minutes.
Press !V to open context menu press keys 1-5 to paste numbered items.
Edit: Changed Delimiters $ to `|
Code: Select all
; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=114923&p=513489#p513489
#Persistent
OnClipboardChange("ClipChanged")
ClipChanged(Type)
{
If (tog113 != 1)
{
CB1 := Trim(Clipboard, " ")
global sos12 := CB1 "`|" sos12
Loop, parse, sos12, `|
{
If A_loopfield is not space
{
If (a_index = 1)
{
Menu, MyMenu, add,,
Menu, Mymenu, DeleteAll
}
If (a_index < 7 )
{
Cl1 := StrReplace(a_loopfield, "`r`n")
Cl1 := StrReplace(CL1, A_space)
Cl1 := StrReplace(Cl1, "`t")
CL1 := SubStr(CL1, 1 ,50)
Menu, MyMenu, add,%a_index%. %CL1%, MenuHandler
}
If (a_index = 6)
{
Menu, Mymenu, Delete, 6&
}
}
}
Tooltip, Copied
sleep 500
Tooltip
settimer, emptyclips, -300000 ; 5minute
}
}
return
menuhandler:
Loop,parse,sos12, `|
{
if (a_index = A_thismenuitempos)
{
global tog113 = 1
sleep 200
clipboard := A_loopfield
send, ^v
Global Tog113 = 0
}
}
return
!v::
If sos12 is not space
{
Menu, MyMenu, Show
}
Else
{
Tooltip, Empty
sleep 200
tooltip
}
return
emptyclips:
sos12 =
Menu, MyMenu, Deleteall
return