Windows – Beep or make a sound upon Cut, Copy, Paste

audioautohotkeyclipboardmacroswindows 10

I have autohotkey installed in my windows 10. How can I have it "beep" or make a sound whenever I Cut, Copy or paste something.

I'm working on a huge record which involves cutting-copying-pasting data around. The problem is sometimes when I copy text, then paste it, the previous data is pasted instead of the new data. It's because sometimes I hit a different button (instead of Ctrl+C Ctrl+X), or maybe the keyboard button was lightly pressed, etc)

So now, I want to make sure that it's already copied or cut or pasted, so I want to hear a sound every time it does new data in the clipboard is really there.

Best Answer

#Persistent            ; keeps a script permanently running

    OnClipboardChange: ; is launched automatically whenever the content of the clipboard changes
time_copied :=""
time_copied :=  A_TickCount
; SoundBeep            ; Play the default pitch and duration.
SoundBeep, 750, 500    ; Play a higher pitch for half a second
If (A_EventInfo = 1)   ; the clipboard contains text or files copied
{
    If (DllCall("IsClipboardFormatAvailable", "uint", 15))  ; the clipboard contains file(s)
        ToolTip, file(s) copied
    else
        ToolTip, text copied
}
else
If (A_EventInfo = 2)   ; the clipboard contains images
    ToolTip, image(s) copied
Sleep 1000
ToolTip
return

; ctrl+v for pasting
~^v::   
    SoundBeep
    time_since_copied := (A_TickCount - time_copied)
    time_since_copied /= 1000
    ToolTip, pasted`ncopied: %time_since_copied% seconds ago
    Sleep, 1500
    ToolTip
return

For details see OnClipboardChange

Related Question