Raja's Exocortex

AutoHotKey Slow Paste

Pasting large number of lines into device consoles can sometimes overwhelm and crash switches. This is common in Cisco SG series switches.

This AutoHotKey script pastes the contents of the clipboard with a delay.

Intended usage is to open ssh console to a Cisco switch and copy all the CLI commands. Then use the below script to slowly paste the clipboard contents into the ssh termial.

; AutoHotKey script
; Filename: slow-paste.ahk
; Slow paste clipboard one line at a time, with 200ms delay between lines
; Copy text to clipboard and press Alt+v to paste
; Press Esc to stop the script

!v::
Loop, Parse, clipboard, `n
{
    SendRaw, %A_LoopField%
;	Send {Enter}
    Sleep, 200
}

; Press Esc to stop pasting
Esc::ExitApp