Hacker News new | ask | show | jobs
by xeonax 1186 days ago
Autohotkey script starts from below line

  #Persistent
  SetTimer, rload, 3600000
  firstrun:=true
  return
  
  
  OnClipboardChange:
  if (firstrun=true)
   Goto, CONSECRUN
  Sleep,500
  curclip:=clipboard
  Sleep,500
  if oldclip<>%curclip%
   FIleAppend,  `r`n===============================  =======`r`n%A_DD%-%A_MMM%- %A_YYYY%: :%A_Hour%:%A_Min%:  %A_Sec%`r`n%Clipboard%,   %A_ComputerName%Tracker.clip
  oldclip:=clipboard
  CONSECRUN:
  firstrun:=false
  return
  
  
  rload:
  Reload
  Sleep 1000 ; If successful,  the  reload will close this  instance  during the Sleep, so the  line  below will never be  reached.
  MsgBox, 4,, The script could  not  be reloaded. Would you like  to  open it for editing?
  IfMsgBox, Yes, Edit
  return
1 comments

It needs to reload regularly coz sometimes it gets stuck. Also might lock the clipboard of too much office document is copied.
Thank you for sharing!