Last active
November 20, 2017 20:28
-
-
Save davebrny/91662fdc77a4ada8659be12337ad6c76 to your computer and use it in GitHub Desktop.
(autohotkey) - remember the clipboard state between restart/shutdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#noEnv | |
; #noTrayIcon | |
#persistent | |
#singleInstance, force | |
onExit, save_clipboard | |
;execute_this ; ex_this( git.io/vFQ1z ) | |
if fileExist(a_scriptDir . "\restart clipboard.txt") | |
{ | |
if (clipboard = "") ; if it hasnt been set to anything else | |
fileRead, clipboard, % a_scriptDir "\restart clipboard.txt" | |
fileDelete, % a_scriptDir "\restart clipboard.txt" | |
} | |
;execute_end | |
if !fileExist(a_startup "\" a_scriptName ".lnk") | |
fileCreateShortcut, % a_scriptFullPath, % a_startup "\" a_scriptName ".lnk" | |
return ; end of auto-execute ---------------------------------------------- | |
save_clipboard: | |
;exit_this | |
if (clipboard) and (a_exitReason = "shutdown") | |
fileAppend, % clipboard, % a_scriptDir "\restart clipboard.txt" | |
;exit_end | |
exitApp | |
/* | |
[script info] | |
version = 0.1.1 | |
description = remember the clipboard state between restart/shutdown | |
author = davebrny | |
source = https://gist.github.com/davebrny/91662fdc77a4ada8659be12337ad6c76 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment