if you use it, please send comments and suggestions.
The hotkey to show the menu is WIN+SPACE
The hotkey to switch between modes is CTRL+WIN+C
To paste an item simple click that item in the menu.
To work with paste/edit/save mode(PES mode) select this mode from tray menu or use the hotkey. Then, when selecting an item from clipboard menu, another menu will let you past, edit or save that item. To quickly paste an item in PES mode, just double click that item
new( 0.8 ):
- now in paste only mode you can edit a clip by holding down CTRL while selecting an item, or save a clip by holding SHIFT key, or preview an item by holding WIN key
- now copying the same clip more times should not put more than one item
- thanks to Anonymous90210 for feedback on "features"
- thanks to missdipsy for feedback on "exit function"
new(0.7):
-choose if to work in paste only mode, or paste/edit/save mode (default is paste only mode)
-CTRL+WIN+C lets you switch between modes
new(0.6):
-customize number of items
-numbers for saved clips
new(0.5):
-when selecting an item from the menu, decide if to paste,edit or save(permanently) it.Pasting is quite like before, only you must double click the item (seeingit it's easier than explaning)
PLEASE TELL ME IF THIS VERSION IS BETTER OR IF YOU PREFERE 0.4.
new(0.4):
-Item show "start...end" of the clipboard if this is too long
tip(0.4):
-if you copy a file: in explorer you will paste the file,
in an editor you will paste the file path
new(0.3):
-it looks better
-files saved on txt files to use them if you want
-support for files(beta)
fixed(0.3):
-now all items paste correctly(before some items around 15 didn't work)
Code:
; ;
; author:Salvatore Agostino Romeo - romeo84@gmail.com
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/*
kiu-clipSave - It keeps trace of last 20(or customize it)
text (or files) items copied on clipboard and
shows them in a menu to quickly paste, edit
or save something later. Now you can choose
if to work in paste only mode, or paste/edit/save mode.
CTRL+WIN+C lets you switch between modes
New in version 0.8:
In Paste only mode:
-if you hold down CTRL while clicking on an item, you will edit that item
-if you hold down SHIFT key while clicking on an item you'll be able to save it.
-if you hold down LWIN key while clicking on an item you'll be able to preview it
on a tooltip(press LButton to unshow the tooltip)
Version: 0.8
License:GPL
Note: sub-project of kiu-radialM
*/
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; USER SETTINGS
numberOfElements:=20
; END
#Persistent
#SingleInstance force
previousClip=
clipIndex:=0
pom=enabled
menu, tray, NoStandard
menu, tray, add, Paste Only mode, pom
menu, tray, add, Paste/Edit/Save mode,pesm
menu, tray, add, Display features, features
menu, tray, add, Exit,exitapplication
Menu,kiu2,add,Paste,clipPaste
Menu,kiu2,add,Edit,clipPaste
Menu,kiu2,add,Save,clipPaste
IfNotExist, data
FileCreateDir, data
IfNotExist, data\saved
FileCreateDir, data\saved
return
^#c::
if(toggleMode())
pom=enabled
else
pom=disabled
return
pom:
pom=enabled
return
pesm:
pom=disabled
return
#Space::
clipMenu()
return
OnClipboardChange:
if(A_EventInfo=1)
{
currentClip=%clipboard%
currentClip_b=%clipboardall%
IfEqual,currentClip, %previousClip%
return
else
previousClip=%clipboard%
}
saveClip()
return
clipMenu()
{
global
startIndex:=clipIndex
Menu,kiu,add
Menu,kiu,DeleteAll
Loop,%numberOfElements%
{
zero=
puntini=
if(StrLen(startIndex)=1)
zero=0
FileReadLine, filec, data\%zero%%startIndex%.txt, 1
FileReadLine, filec, data\%zero%%startIndex%.txt, 1
if(StrLen(filec)>35)
{
toCut:=StrLen(filec)-18
StringMid, itemTemp1, filec, 1, 12
StringTrimLeft, itemTemp2, filec, %toCut%
itemTemp=%itemTemp1%...%itemTemp2%
}
else
itemTemp=%filec%
if(A_Index<10)
Menu,kiu,add,%A_Space%%A_Space%%A_Index%. %itemTemp%,clipSelect
else
Menu,kiu,add,%A_Index%. %itemTemp%,clipSelect
startIndex--
if(startIndex=0)
startIndex:=numberOfElements
}
Menu,kiu,add
Menu,kiuSaved,add
Menu,kiuSaved,deleteAll
Loop,data\saved\*.txt
{
if(StrLen(A_Index)=1)
zero=0
Menu,kiuSaved,add,%zero%%A_Index%. %A_LoopFileName%,clipSaved
}
Menu,kiuSaved,add,Cancel,Cancel
Menu,kiu,add,Saved Clips, :kiuSaved
Menu,kiu,add,Cancel,Cancel
Menu,kiu,show
return
}
saveClip()
{
global
currentIndex()
FileDelete, data\%clipIndex%.txt
FileAppend, %currentClip%, data\%clipIndex%.txt
FileDelete, data\%clipIndex%_b.txt
FileAppend, %currentClip_b%, data\%clipIndex%_b.txt
return
}
;index of the clip.This is done to implement a sort of queue structure
currentIndex()
{
global
clipIndex++
If(clipIndex=21)
clipIndex=1
if(StrLen(clipIndex)=1)
clipIndex=0%clipIndex%
return
}
Cancel:
return
clipSaved:
StringTrimLeft, OutputVar, A_ThisMenuItem, 4
Run,data\saved\%OutputVar%
return
clipSelect:
if(pom="enabled")
{
clipSelectedItemPos:= A_ThisMenuItemPos
goto,clipPaste
}
else
{
MouseGetPos, x, y
clipSelectedItemPos:= A_ThisMenuItemPos
inX:=x-25
inY:=y-10
Menu,kiu2,show, %inX%, %inY%
}
return
;when pressing an item of a menu
clipPaste:
fileNum := clipIndex - clipSelectedItemPos + 1
if(fileNum < 0)
fileNum := numberOfElements + fileNum
if(StrLen(fileNum)=1)
fileNum=0%fileNum%
selection=%A_ThisMenuItemPos%
if(pom="enabled")
{
if(GetKeyState("CTRL" , "P"))
{
Run,data\%fileNum%.txt
return
}
if(GetKeyState("Shift" , "P"))
{
InputBox, name, Name of the clip, Select the name for the clip
FileCopy,data\%fileNum%.txt,data\saved\%name%.txt
return
}
if(GetKeyState("LWIN" , "P"))
{
FileRead, content, data\%fileNum%.txt
tooltip, %content%
KeyWait, LButton, D
tooltip,
return
}
}
else
{
if(selection=2)
{
Run,data\%fileNum%.txt
return
}
if(selection=3)
{
InputBox, name, Name of the clip, Select the name for the clip
FileCopy,data\%fileNum%.txt,data\saved\%name%.txt
return
}
}
FileRead, clip, data\%fileNum%.txt
clipboard=
clipboard=%clip%
Send,^v
SetTitleMatchMode, 2
IfWinExist, xplore
IfWinActive, xplore
{
FileRead,clip_b, *c data\%fileNum%_b.txt
clipboard=%clip_b%
Send,^v
}
IfWinExist, ahk_class ExploreWClass
IfWinActive, ahk_class ExploreWClass
{
FileRead,clip_b, *c data\%fileNum%_b.txt
clipboard=%clip_b%
Send,^v
}
return
toggleMode()
{
static m
m := !m
Return, m
}
features:
msgbox,
(
Clipboardmenu's features:
The hotkey to show the menu is WIN+SPACE .
To paste an item simple click that item in the menu. If you hold down CTRL while clicking
on an item, you will edit that item. If you hold down SHIFT key while clicking on an item
you'll be able to save it.
ClipboardMenu support another working mode called Paste/Edit/Save mode.
This will let you paste/edit/save your clips using mouse only.
The hotkey to switch between modes is CTRL+WIN+C .
To work with paste/edit/save mode(PES mode) select this mode
from tray menu or use the hotkey. Then, when selecting an item
from clipboard menu, another menu will let you past, edit or
save that item. To quickly paste an item in PES mode, just
double click that item.
If you copy a file: in explorer you will paste the file,
in an editor you will paste the file path
)
return
exitapplication:
exitapp
return