Possible to create a clipboard history viewer in DOpus?

I'm wondering if a clipboard history viewer can be made in DOpus. I'm thinking of a simple menu which lists the last 10 clipboard entries; scrolling down and clicking one of them would recopy the selection to the clipboard. Anyone managed to do this?

Opus can't do this currently however there are a number of clipboard utilities out there that will do the job including several text editors (for capturing text only though).

I also use the TreePad database program (http://www.treepad.com/) and it'll collect text and images copied to the clipboard. Then I have one other utility which used to be free (but now they want $40 for it) called Clipboard Buddy (http://www.clipboardbuddy.com/) and that does exactly what you're asking for.

Thanks for the suggestions; I checked out both links you posted and they both look like good programs, but a little too full-featured for what I'm looking for (and expensive). I've found an alternative to getting my intended functionality in DOpus using Autohotkey. The result is a small menu that pop ups whenever you press a hotkey or a button in DOpus (whichever you prefer) and the last 15 clipboard entries are listed; you simply have to select whichever one you want and it's recopied to the current clipboard and ready to be pasted anywhere. In case anyone is interested, this is what I did:

  1. Copy the following script into notepad and name it whatever you like, but give it the ".ahk" extension:

[code];Clipboard History, By ManaUser

;Command Key Alternate (commented out)
;Pop Up Menu Alt + C
;Older Win + Up Win + A
;Newer Win + Down Win + Z
;Delete Current Win + Delete Win + X
;Clear History Win + Shift + Delete Win + Shift + X
;Empty Clipboard Win + Ctrl + Delete Win + Ctrl + X

MAX_CLIPS = 15
TIP_DELAY = 2

#SingleInstance Force
#NoEnv

LastClip = 0
;Menu TRAY, Icon, Shell32.dll, 22, 1
SetTimer WatchWait, -1000
Return

;#a::
#Up::
If (LastClip = 0)
Return
CurClip--
If (CurClip < 1)
CurClip := LastClip
Temp := SavedShortClip%CurClip%
ToolTip %Temp%
SetTimer KillToolTip, % TIP_DELAY * -1000
Watch := 0
Clipboard := SavedClip%CurClip%
SetTimer WatchWait, -1000
Return

;#z::
#Down::
If (LastClip = 0)
Return
CurClip++
If (CurClip > LastClip)
CurClip := 1
Temp := SavedShortClip%CurClip%
ToolTip %Temp%
SetTimer KillToolTip, % TIP_DELAY * -1000
Watch := 0
Clipboard := SavedClip%CurClip%
SetTimer WatchWait, -1000
Return

;#x::
#Delete::
If (LastClip = 0)
Return
SavedClip%CurClip% =
SavedShortClip%CurClip% =
Temp =
Collapse(CurClip)
ToolTip History Item Deleted.
SetTimer KillToolTip, % TIP_DELAY * -1000
Return

;#+x::
#+Delete::
Loop %MAX_CLIPS%
{
SavedClip%A_Index% =
SavedShortClip%A_Index% =
}
LastClip := 0
NewClip := 0
CurClip := 0
ToolTip Clipboard History Cleared.
SetTimer KillToolTip, % TIP_DELAY * -1000
Return

OnClipboardChange:
If (Watch = 0 OR A_EventInfo = 0 )
{
Watch := 0 ; For improved compatibility with
SetTimer WatchWait, -1000 ; other AutoHotkey scripts that
Return ; access the clipboard.
}
If (A_EventInfo = 1) ;Text
{
NewClip++
If ( NewClip > MAX_CLIPS)
NewClip := 1
If ( NewClip > LastClip)
LastClip := NewClip
CurClip := NewClip
SavedClip%NewClip% := ClipboardAll
Temp := Clipboard
Temp := RegExReplace(Temp, "^\s*|\s*$", "")
If (StrLen(Temp) > 100 OR InStr(Temp, "n") ) Temp := RegExReplace(Temp, "as)^([^rn]{1,50}).*?([^rn]{1,50})$", "$1...`n...$2")
SavedShortClip%NewClip% := Temp
Loop %LastClip%
Temp =
}
Return

#^Delete::
Clipboard =
ToolTip Clipboard Cleared.
SetTimer KillToolTip, % TIP_DELAY * -1000
Return

Collapse(Position)
{
Global
If (CurClip > Position)
CurClip--
Loop ;While Position < LastClip
{
Temp := Position + 1
SavedClip%Position% :=SavedClip%Temp%
SavedShortClip%Position% :=SavedShortClip%Temp%
Position++
If (Position >= LastClip)
Break
}
SavedClip%LastClip% =
SavedShortClip%LastClip% =
LastClip--
If (NewClip > LastClip)
NewClip := LastClip
}

KillToolTip:
Tooltip
Return

WatchWait:
Watch := 1
Return

!c::
Menu, ClipbrdHist, Add
Menu, ClipbrdHist, DeleteAll
Loop %LastClip%
{
Menu, ClipbrdHist, Add, % ((A_Index = CurClip) ? "*" : "") A_Index . ": " . SavedShortClip%A_Index%, ChangeClip
}
Menu, ClipbrdHist, show
return

ChangeClip:
CurClip := A_ThisMenuItemPos
Watch := 0
Clipboard := SavedClip%CurClip%
SetTimer WatchWait, -1000
return[/code]

In order to run the script you must have Autohotkey installed (it's free and one of the greatest utilities I've come across for Windows). You can also run this script pre-compiled into an executable so you don't have to install Autohotkey (if anyone wants, I can post the compiled executable).

  1. Once you run the script it's pretty simple: press Alt + C to have the last 15 things you copied pop up instantly. You then simply need to select which piece of text you want to have in the current clipboard and it's instantly ready to have pasted anywhere. The script also assigns other hotkeys to perform related functions like clearing the contents of the clipboard and scrolling through the list using the keyboard (all functions are documented at the beginning of the script). All of these keys can be reassigned of course to suit your needs.

  2. The script works really well by simply using the hotkey combination, but I decided to make a button in DOpus which triggers the hotkey. I created a VB script and put it into the DOpus scripts folder; the script simply sends a keystroke, namely the keystroke you have configured for the clipboard pop up menu (in this case, Alt + C). This is the vb script; just copy it into notepad, name it what you like but with the ".vbs" extension. Afterwards, place the script into the DOpus "Scripts" folder which should be located in C:\Documents and Settings%User%\Application Data\GPSoftware\Directory Opus\Scripts

Dim WshSHell set WshShell = CreateObject("WScript.Shell") WshShell.SendKeys ("%c")

  1. Once it's in your "Scripts' folder, you can simply make a button in DOpus to execute the script like so:
{A|dopusdata}scripts\ClipHistory.vbs

In the example above, the vb script is named "ClipHistory.vbs". Change this if you have named the vb script differently.

That's it. Now I just press the button and the last 15 clipboard entries pop up instantly and ready to select. You can also change the Autohotkey script to allow more or less than 15 entries in the pop up menu. I'm sure most people can do without the DOpus button and simply use the hotkey to have the menu pop up...I guess it's just a matter of preference. Here's a screen shot:

Yoink!!!
Stolen for my scrit collection!!! Thank you for sharing :slight_smile:

If you notice the screen shot I give credit to the author of the script - I never in my post implied that I was the author of the script and clearly stated that I found an alternative to getting my intended functionality. If you are the original author of the script, thanks again for it! :slight_smile: But I would refrain from using words such as "stolen" seeing as I never took credit for any of it.

I think PaladinMJ was saying that he had stolen it for his script collection, not that you had stolen it :slight_smile:

It's funny how I've become accustomed to reading posts (not just in this forum) written in English by non-native speakers. Prepositions such as "for" are often confused with "from" and in this case, that can make quite a difference in meaning. I also noticed the quote (not quite sure why it was necessary to include in the post) so I guess I automatically assumed...

In any case, if I misunderstood you chap, my apologies :slight_smile:

only the last clip is ever availbale to me

Strange...works fine for me. Just taking a guess but some possible reasons it may not be working for you is that you have some other autohotkey scripts running that are interfering or you've added this script to another autohotkey script (perhaps you've combined all your scripts into one which starts at system startup like myself). If it's the latter, try rearranging the position of this script to the top of the "master" autohotkey script; when I first added it to my main script it wasn't registering all my input. I moved it to the top of my script and it worked without a hitch.

Also, if you use the "Windows Key + Up" or "Windows Key + Down" hotkey it only shows you one entry at a time. Repeatedly pressing those hotkeys will scroll through the list of clips, one at a time. If you use the "Alt +C" hotkey, you will see the entire list at once and can select either by mouse or by scrolling up or down.

I moved it to the top .... seems to have fixed it .. Thx

@yaramorgan.

I haven't tested out your clipboard history button...yet. But kudos for trying to figure out and getting something that apparently works. :smiley:

I also wanted to let you know of a supplementary must-have program that I use. It goes on every 'puter I use first thing after the OS and DOpus... I use an app called True Launch Bar. It is quite configurable. As an FYI, it has a clipboard history plugin that I use religiously. The neat thing about it is that it allows you to 1. lock content that you use all the time and 2. clear contents of the list very easily. It can also be configured to hold as many or as few entries as you wish and supports drag and drop.

I've attached a screenshot (with contents darkened out :slight_smile: ) that will show you what it looks like. Very simple but full-featured for what I need. BTW, it resides in the quick launch area of the taskbar as TLB really is a quick launch replacement. But it also has a standlaone version that can be configured however you wish...

Just wanted to give you a chance to look at TLB if you hadn't heard of it or maybe get some ideas for your button for further development... Just a thought.

Very cool program - thanks for the suggestion :smiley:

Will download trial and give it a try...