Advertisement
Najeebsk

CLIPBOARD.ahk

Apr 10th, 2023
1,263
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 , CLIPBOARD.ahk, %A_ScriptDir%\DATA\CLIPBOARD.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\CLIPBOARD.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. Global clip := [], max := 20, choices, clipNum
  28. SkinForm(Apply, A_ScriptDir . "\DATA\SkinH_EL.dll", A_ScriptDir . "\DATA\S12.she")
  29. OnExit, GetOut
  30. CustomColor = FFFF99
  31. Gui, Color, %CustomColor%
  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, % choices := "|" SubStr(Clipboard, 1, 25) "||" Trim(StrReplace(choices, "||", "|"), "|")
  52. }
  53.  
  54. WM_LBUTTONUP(wParam := "", lParam := "") {  ; User clicked on the GUI
  55.  Gui, Submit
  56.  SendInput % "{Text}" clip[clipNum]
  57. }
  58. ;-=-=-=-=-=-=-=-=-=-=-=-=-About-=-=-=-=-=-=-=-=-=-=-=-
  59.     ^H::
  60.     MsgBox, , About ShowHide,
  61.     (
  62.         This program will ClipBoard Text And Files List To
  63.          Write Notepade .
  64.         The defined hotkeys are:
  65.        Ctrl+C          Selected Text Copy To ClipBoard
  66.          F12             ClipBoard Show Windows
  67.          ESC            ExitApp
  68.         -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  69.         Works on both Windows XP and Windows 7
  70.         By Najeeb Shah Khan 2022
  71.     )
  72. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73. GetOut:
  74. ;GuiClose:
  75. Gui, Hide
  76. SkinForm(0)
  77. ExitApp
  78. return
  79.  
  80. SkinForm(Param1 = "Apply", DLL = "", SkinName = ""){
  81.     if(Param1 = Apply){
  82.         DllCall("LoadLibrary", str, DLL)
  83.         DllCall(DLL . "\SkinH_AttachEx", AStr,SkinName, Str,"mhgd")
  84.     }else if(Param1 = 0){
  85.         DllCall(DLL . "\USkinExit")
  86.         }
  87. }
  88. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89. ;#R::Reload  ;<--  ~ Reload Script ~
  90. #S::Suspend ;<--  ~ Suspend Script ~
  91. #P::Pause   ;<--  ~ Pause Script ~
  92. #M::WinMinimize, ;<--  ~ Minimize Script ~
  93. ESC::ExitApp     ;<--  ~ Exit Script ~
  94. ;=-=-=-=-=-=-=-=-=-=- END SCRIPT -=-=-=-=-=-=-=-=-=-=-=-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement