1) Select The text that you use want to paste somewhere else later. Than press Ctrl+Alt+C. Give it a title when the inputbox appears. Select as many sections of text as you want.
2) Go to where you wan to paste the text and hold down the middle mouse button for a second. A menu will appear with all of the titles you enter earlier.
3) Left click on one of the titles and the text you copied earlier and gave that title will be copied into the open window.
4) To delete an item, Hold down F2 and Click the menu item.
The Script requires the latest version of Autohotkey.
MenuTitle = ========= ;Delay after which the menu is shown UMDelay = 20 SetFormat, float, 0.0 SetBatchLines, 10ms ;Creates ini file if it doesn't exist ifnotexist, %a_scriptdir%\ToolTipMenu.ini, fileappend, [MenuItem]`nName=, %a_scriptdir%\ToolTipMenu.ini Exit ;<<<<Reads Menu names from ini file>>>> Mbutton:: IniRead, name, ToolTipMenu.ini, MenuItem, Name Loop, parse, name, `, { if name = { break } MenuItem%a_index% = %A_LoopField% } ;<<<<Sets menu delay>>>> HowLong = 0 Loop { HowLong ++ Sleep, 10 GetKeyState, Mbutton, Mbutton, P If Mbutton = U { Break } } If HowLong < %UMDelay% { Return } Menu = %MenuTitle% ;<<<<Creates Menu Items to be displayed>>>> Loop { If MenuItem%a_index% = { Break } MenuItems ++ StringTrimLeft, MenuText, MenuItem%a_index%, 0 Menu = %Menu%`n%MenuText% } ;<<<<Displays Menu>>>> ToolTip, %Menu% WinActivate, %MenuTitle% Return ;<<<<Turns Menu off >>>> ~LButton:: GetKeyState, state, F2 IfWinNotActive, %MenuTitle% { ToolTip Return } ;<<<<Gets Mouse position and position of menu items>>>> MouseGetPos, mX, mY ToolTip mY -= 3 ;space after which first line starts mY /= 13 ;space taken by each line IfLess, mY, 1, Return IfGreater, mY, %MenuItems%, Return ;<<<<Finds name of text file>>>> j=1 Loop, parse, name, `, { if j = %mY% { docname=%A_LoopField% break } j++ } ;<<<<If key is held down, item is deleted>>>> if state =D { FileDelete, %docname%.txt IniRead, name, ToolTipMenu.ini, MenuItem, name, (blank) j=1 Loop, parse, name, `, { j++ } two=2 if j=%two% { StringReplace, newname, name, %docname%, } else { i=%j% i-=1 if mY=%i% { StringReplace, newname, name, `,%docname%, } else { StringReplace, newname, name, %docname%`,, } } iniWrite, %newname%, ToolTipMenu.ini, MenuItem, name reload EXIT } ;<<<<Reads from text file and send each line to window>>>> sleep, 100 setkeydelay, 0 Loop, read, %docname%.txt { Loop, parse, A_LoopReadLine { send, %A_LoopField% } } Return ;<<<<Copies selected text to file>>>> ^!c:: clipboard= Winactivate send, ^c ClipWait, 3 if ErrorLevel <> 0 { MsgBox, The attempt to copy text onto the clipboard failed. return } copied=%clipboard% AutoTrim, On StringLeft, default, copied, 25 StringReplace, default, default, `r, %A_Space%,all StringReplace, default, default, `n, %A_Space%,all sleep, 100 InputBox, menu, Menu Title, Please enter a menu title, , 400, 150, , , , , %default% menu=%menu% IniRead, name, ToolTipMenu.ini, MenuItem, Name, (blank) j=1 Loop, parse, name, `, { if menu = %A_LoopField% { msgbox, Error`, The same menu name cannot be specified more than once EXIT } j++ } FileAppend, %copied%`n, %menu%.txt IniRead, name, ToolTipMenu.ini, MenuItem, Name, (blank) if name= { IniWrite, %menu%, ToolTipMenu.ini, MenuItem, Name EXIT } IniWrite, %menu%`,%name%, ToolTipMenu.ini, MenuItem, Name IniRead, name, ToolTipMenu.ini, MenuItem, Name, (blank) Sort, name, D, StringLeft, firstletter, name, 1 comma=`, if firstletter = %comma% { StringTrimLeft, name, name, 1 } IniWrite, %name%, ToolTipMenu.ini, MenuItem, Name
Thanks to Rajat for the menu and giving me the idea of how to make the menu dynamic.
edit:
just made a couple changes to the script to make it more reliable