daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Aug 20th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ; Retrieves saved clipboard information since when this script last ran
  3. Loop C:\tmp\clipvar*.txt
  4. {
  5.   clipindex += 1
  6.   FileRead clipvar%A_Index%, %A_LoopFileFullPath%
  7.   FileDelete %A_LoopFileFullPath%
  8. }
  9. maxindex := clipindex
  10. OnExit ExitSub
  11.  
  12. ; Clears the history by resetting the indices
  13. ^+NumpadClear::
  14. ^+Numpad5::
  15. tooltip clipboard history cleared
  16. SetTimer, ReSetToolTip, 1000
  17. maxindex = 0
  18. clipindex = 0
  19. Return
  20.  
  21. ; Scroll up and down through clipboard history
  22. ^+WheelUp::
  23. if clipindex > 1
  24. {
  25.   clipindex -= 1
  26. }
  27. thisclip := clipvar%clipindex%
  28. clipboard := thisclip
  29. tooltip %clipindex% - %clipboard%
  30. SetTimer, ReSetToolTip, 1000
  31. Return
  32. ^+WheelDown::
  33. if clipindex < %maxindex%
  34. {
  35.   clipindex += 1
  36. }
  37. thisclip := clipvar%clipindex%
  38. clipboard := thisclip
  39. tooltip %clipindex% - %clipboard%
  40. SetTimer, ReSetToolTip, 1000
  41. Return
  42.  
  43. ; Add clipboard contents to the stack when you copy or paste using the keyboard
  44. ~^x::
  45. ~^c::
  46. Sleep 500
  47. clipindex += 1
  48. clipvar%clipindex% := clipboard
  49. thisclip := clipvar%clipindex%
  50. tooltip %clipindex% - %thisclip%
  51. SetTimer, ReSetToolTip, 1000
  52. if clipindex > %maxindex%
  53. {
  54.   maxindex := clipindex
  55. }
  56. Return
  57.  
  58. ; Clear the ToolTip
  59. ReSetToolTip:
  60.     ToolTip
  61.     SetTimer, ReSetToolTip, Off
  62. return
  63.  
  64. ; Saves the current clipboard history to hard disk
  65. ExitSub:
  66. SetFormat, float, 06.0
  67. Loop %maxindex%
  68. {
  69.   zindex := SubStr("0000000000" . A_Index, -9)
  70.   thisclip := clipvar%A_Index%
  71.   FileAppend %thisclip%, C:\tmp\clipvar%zindex%.txt
  72. }
  73. ExitApp
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top