Advertisement
Najeebsk

CLIPBOARD2.ahk

Apr 10th, 2023
1,378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*   INFO
  2.    NAJEEB SAVE MULTIPLE ITEMS TO CLIPBOARD
  3.    Written by: Najeeb Shah Khan (najeebshahkhan@gmail.com)
  4.    Last Modified: 4-6-2023
  5. */
  6. ;#warn
  7. #NoEnv
  8. #LTrim
  9. #SingleInstance, Force
  10. Process, Priority, , A
  11. SendMode, Input
  12. SetBatchLines, -1
  13. ;#NoTrayIcon
  14. SetKeyDelay 0    ; In case SendInput is not available
  15. SetTitleMatchMode RegEx
  16. SetWorkingDir %A_WorkingDir% ;%A_ScriptDir%  
  17. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  18. FileCreateDir, %A_ScriptDir%\DATA
  19. FileInstall , CLIPBOARD2.ahk, %A_ScriptDir%\DATA\CLIPBOARD2.ahk, 1
  20. FileInstall , S12.she, %A_ScriptDir%\DATA\S12.she, 1
  21. FileInstall , SkinH_EL.dll, %A_ScriptDir%\DATA\SkinH_EL.dll, 1
  22. FileSetAttrib +HS, %A_ScriptDir%\DATA\CLIPBOARD2.ahk, 2
  23. FileSetAttrib +HS, %A_ScriptDir%\DATA\S12.she, 2
  24. FileSetAttrib +HS, %A_ScriptDir%\DATA\SkinH_EL.dll, 2
  25. FileSetAttrib +HS, %A_ScriptDir%\DATA, 2
  26. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  27. SkinForm(Apply, A_ScriptDir . "\DATA\SkinH_EL.dll", A_ScriptDir . "\DATA\S12.she")
  28. OnExit, GetOut
  29. CustomColor = FFFF99
  30. Gui, Color, %CustomColor%
  31. Global clip := [], max := 20, choices, clipNum
  32. Gui, Font, s12
  33. Gui, Add, ListBox, w800 r21 AltSubmit vclipNum
  34. Gui, Add, Button, xm ym Hidden Default gWM_LBUTTONUP, OK
  35. OnClipboardChange("clipChanged"), OnMessage(WM_LBUTTONUP := 0x0202, "WM_LBUTTONUP")
  36.  
  37. F12::Gui, Show,, Najeeb Clipboard
  38.  
  39. GuiEscape:
  40. GuiClose:
  41. Gui, Hide
  42. Return
  43.  
  44. clipChanged(type) {
  45.  If (type != 1)
  46.   Return
  47.  SoundBeep, 2500
  48.  If clip.Count() = max
  49.   clip.RemoveAt(max), choices := RegExReplace(choices, ".+\K\|.*")
  50.  clip.InsertAt(1, Clipboard)
  51.  GuiControl,, clipNum
  52.   , % choices := "|" SubStr(Clipboard, 1, 25) "||" Trim(StrReplace(choices, "||", "|"), "|")
  53. }
  54.  
  55. WM_LBUTTONUP(wParam := "", lParam := "") {  ; User clicked on the GUI
  56.  Gui, Submit
  57.  Sleep, 25
  58.  SendInput % "{Text}" clip[clipNum]
  59.  Sleep, 50
  60.  Gosub, F12
  61. }
  62. ;-=-=-=-=-=-=-=-=-=-=-=-=-About-=-=-=-=-=-=-=-=-=-=-=-
  63.     ^H::
  64.     MsgBox, , About ShowHide,
  65.     (
  66.         This program will ClipBoard Text And Files List To
  67.          Write Notepade .
  68.         The defined hotkeys are:
  69.        Ctrl+C          Selected Text Copy To ClipBoard
  70.          F12             ClipBoard Show Windows
  71.          ESC            ExitApp
  72.         -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73.         Works on both Windows XP and Windows 7
  74.         By Najeeb Shah Khan 2022
  75.     )
  76. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  77. GetOut:
  78. ;GuiClose:
  79. Gui, Hide
  80. SkinForm(0)
  81. ExitApp
  82. return
  83.  
  84. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  85.     if(Param1 = Apply){
  86.         DllCall("LoadLibrary", str, DLL)
  87.         DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
  88.     }else if(Param1 = 0){
  89.         DllCall(DLL . "\USkinExit")
  90.         }
  91. }
  92. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  93. #R::Reload  ;<--  ~ Reload Script ~
  94. #S::Suspend ;<--  ~ Suspend Script ~
  95. #P::Pause   ;<--  ~ Pause Script ~
  96. #M::WinMinimize, ;<--  ~ Minimize Script ~
  97. ESC::ExitApp     ;<--  ~ Exit Script ~
  98. ;=-=-=-=-=-=-=-=-=-=- END SCRIPT -=-=-=-=-=-=-=-=-=-=-=-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement