^d:: ; Ctrl + d Clipsaved := clipboardall Clipboard = Send ^c Clipwait Fileappend, %clipboard%`n, somefilename.txt Clipboard := clipsaved Run, somefilename.txt Return

Public Class Form1
Public oldCPText As String = ""
Public writeCount As Long = 0
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Clipboard.ContainsText() Then
Dim tmpCPText As String = Clipboard.GetText
If tmpCPText <> oldCPText Then
''new text in clipboard
oldCPText = tmpCPText
System****.File.AppendAllText("somefilename.txt", tmpCPText) ''save it to file
writeCount += 1
Label2.Text = writeCount.ToString()
If CheckBox1.Checked Then
Beep()
End If
End If
End If
End Sub
End Class
#include <cstdio>
#include <windows.h>
#pragma comment(lib, "USER32")
/*
Auto copy-paster by Harava
07.10.2014
*/
int main()
{
HANDLE hClipData = NULL;
HANDLE hLastClipData = NULL;
long iClipSize = 0, iItemsSaved = 1;
char * szClipData = NULL;
char * szLastClipData = NULL;
FILE * fOut = fopen("clipboard.txt", "a");
if(fOut == NULL)
return -1;
while(!GetAsyncKeyState(VK_ESCAPE))
{
OpenClipboard(NULL);
if(!IsClipboardFormatAvailable(CF_TEXT))
{
printf("Clipboard has something other than text!\n");
CloseClipboard();
Sleep(1000);
continue;
}
hClipData = GetClipboardData(CF_TEXT);
iClipSize = strlen((char*)hClipData);
szClipData = (char*)malloc(iClipSize+1);
memcpy(szClipData, (char*)hClipData, iClipSize+1);
if(szLastClipData != NULL)
{
if(strcmp(szClipData, szLastClipData) != 0)
{
printf("Clipboard changed.\nSaving stuff to file.\n\n");
fprintf(fOut, "********** CLIPBOARD ITEM %d ( %d bytes ) **********\n\n", iItemsSaved, iClipSize);
fwrite(szClipData, 1, iClipSize, fOut);
fprintf(fOut, "\n\n********** END OF ITEM %d **********\n\n", iItemsSaved);
fflush(fOut);
iItemsSaved++;
}
}
free(szLastClipData);
szLastClipData = (char*)malloc(iClipSize+1);
memcpy(szLastClipData, szClipData, iClipSize+1);
free(szClipData);
CloseClipboard();
Sleep(100);
}
fclose(fOut);
return 0;
}

Public Class Form1
Public oldCPText As String = ""
Public writeCount As Long = 0
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Clipboard.ContainsText() Then
Dim tmpCPText As String = Clipboard.GetText
If tmpCPText <> oldCPText Then
''new text in clipboard
oldCPText = tmpCPText
System****.File.AppendAllText(My.Settings.outputFilename, tmpCPText & Environment.NewLine) ''save it to file
writeCount += 1
Label2.Text = writeCount.ToString()
If CheckBox1.Checked Then
Beep()
End If
End If
End If
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.KeyValue = Keys.F2 Then
Dim userResponse As String = InputBox("Please enter the new output filename:", "somefilename.txt", "somefilename.txt")
If userResponse.Length = 0 Then
MsgBox("Invalid output file name. Name unchanged.")
ElseIf userResponse.EndsWith(".txt") = False Then
MsgBox("Invalid output file name. Must end in .txt. Name unchanged.")
Else
My.Settings.outputFilename = userResponse
lblFilename.Text = "File: " & My.Settings.outputFilename
MsgBox("Filename changed OK.")
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lblFilename.Text = "File: " & My.Settings.outputFilename
End Sub
End Class