forked from JeroenBos/AHK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStoreClipboard.ahk
More file actions
30 lines (23 loc) · 823 Bytes
/
StoreClipboard.ahk
File metadata and controls
30 lines (23 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#Persistent
;NOTE: This script (currently) requires to be compiled by the A32 ANSI 32-bit base file to not be flagged as potentially dangerous by Windows
global Filename
Filename=%USERPROFILE%\Desktop\Clipboard.txt
OnClipboardChange("WriteClipboardToFile")
WriteClipboardToFile(Type)
{
; 1 = Clipboard contains something that can be expressed as text (this includes files copied from an Explorer window).
if (Type = 1)
{
copy = %clipboard%
copy := Trim(copy, OmitChars := " `t`r`n")
copy := StrReplace(copy, "`r")
copy := StrReplace(copy, "`n")
FormatTime, timestamp,, hh:mm:ss tt
FileAppend, %A_YYYY%-%A_MM%-%A_DD% %A_Hour%:%A_Min%:%A_sec%.%A_MSec% | %copy%`n, %Filename%
}
Else
{
FileAppend, Not text`n, %Filename%
}
return
}