hi5 / CL3

Minimal clipboard caching utility inspired by CLCL 📋
https://autohotkey.com/boards/viewtopic.php?f=6&t=814
MIT License
88 stars 16 forks source link

Plugin - Clipchain: HotKey to add/insert selected text to the clipchain #8

Closed hi5 closed 6 years ago

hi5 commented 6 years ago

@jasondavis #6

On another note I am looking to modify the ClipChain code to allow a HotKey to add/insert selected text to the clipchain so I can open the ClipChain GUI and then copy new items to the chain without having to always use the Insert GUI.
Is this a feature you would be interested in as well?

Where would you like to insert new entries, at the start, end or at the current "location" (index) just like it would using the Gui? Below a piece of test code which seems to work, you can add that for example to plugins\myplugins.ahk so you don't have to modify ClipChain.ahk directly (yet).

The hotkey #+i is setup here to work when the ClipChain gui isn't visible but you can change that easily of course. I do like the idea in general but I usually prepare by ClipChain in my editor and then "load from clipboard" and I'd like to have control over where to insert any changes using the Gui but if you keep the code below in plugins\myplugins.ahk you don't have to worry about possible updates overwriting your modifications.

#If !WinExist("CL3ClipChain ahk_class AutoHotkeyGUI")
#i::
Send ^c
Sleep 100
ClipChainData.InsertAt(ClipChainIndex+1,Clipboard)
;ClipChainData.Push(Clipboard) ; "add/append" to chain
;ClipChainData.InsertAt(1,Clipboard) ; insert at start of chain
Gosub, ClipChainListview
Return
#If