← Back to Blog

Developers & Code | Oct 5, 2026 | 6 min read

The Best AutoHotkey Clipboard Scripts (v2)

By Deepender Yadav

The Best AutoHotkey Clipboard Scripts (v2) — Edge Drop Guide

AutoHotkey is the power user's answer to "Windows won't do this." It is a free scripting language for automating Windows, and its clipboard support is a full API: read the clipboard, write it, watch it for changes, save and restore all its formats. With a dozen lines you can build clipboard features no app ships.

One version note first: AutoHotkey v2 is the current version, and its syntax differs from v1. Old v1 scripts floating around forums will not run unchanged. Everything below is v2. Start scripts with #Requires AutoHotkey v2.0 so they fail loudly on the wrong interpreter instead of misbehaving.

The five primitives

The official v2 docs define the whole toolkit. These five cover nearly every clipboard script:

  • A_Clipboard is the clipboard as a variable. A_Clipboard := "my text" sets it. A_Clipboard := "" empties it.
  • A_Clipboard := A_Clipboard converts whatever is on the clipboard to plain text. This one line is a paste-without-formatting engine.
  • A_Clipboard .= " Text to append." appends instead of replacing.
  • OnClipboardChange calls your function every time the clipboard changes. This is how script-built history works.
  • ClipboardAll() saves the entire clipboard, all formats, to a variable or file. Assign it back to A_Clipboard to restore. ClipWait pauses until the clipboard actually contains data.

Script 1: plain-text paste on Ctrl+Alt+Shift+V

The most useful five-line clipboard script in existence. It converts the clipboard to plain text, pastes, then restores the original so nothing is lost:

#Requires AutoHotkey v2.0
^!+v:: {
    saved := ClipboardAll()      ; save everything, all formats
    A_Clipboard := A_Clipboard    ; convert the copy to plain text
    Send "^v"                    ; paste
    Sleep 200                    ; let the paste land
    A_Clipboard := saved         ; restore the original
    saved := ""                  ; free the memory
}

Press Ctrl+Alt+Shift+V anywhere and the paste arrives without fonts, colors, or table markup. The app-specific chord Ctrl+Shift+V does the same where supported (How to Paste Without Formatting on Windows), but this hotkey works everywhere, in every app, because the conversion happens before the paste.

Script 2: a 25-slot clipboard history

The MultiClip script in xypha's AHK-v2-scripts collection is the canonical example: a clipboard array that automatically saves text every time you copy, using OnClipboardChange. The default is 25 slots, customizable to any number via a limit variable. Copy normally; the script files each copy into the array. Recall a slot with a hotkey.

This is Ditto's core loop rebuilt as a script: automatic capture on copy, numbered slots, hotkey recall. It is text-focused and has no GUI history window, no image previews, no search UI. If that sounds like enough, it is a 30-line program. If you want search and previews, you want a real manager: Edge-Drop vs Ditto: Hover Shelf or Tray History?.

Script 3: text cleanup on copy

Clipboard text from the wild is dirty: tracking parameters, smart quotes, stray whitespace. A cleanup function runs on every copy via OnClipboardChange and fixes the text before it lands:

A_Clipboard := StrReplace(A_Clipboard, "ABC", "DEF")

That docs example replaces one string with another; generalize it. Strip utm_ parameters, collapse double spaces, trim trailing whitespace. The manual version of this job is How to Strip Tracking and Soft Hyphens From Copied Text. The script version does it before you even paste.

Script 4: append to the clipboard instead of replacing

Normal copying destroys the previous copy. An append hotkey collects instead:

^+c:: {                      ; Ctrl+Shift+C appends
    old := A_Clipboard
    Send "^c"
    ClipWait
    A_Clipboard := old . "`r`n" . A_Clipboard
}

Select a paragraph, Ctrl+Shift+C, select another, Ctrl+Shift+C. The clipboard now holds both, separated by a line break. Paste once. Researchers assembling quotes from several pages live in this script.

Script 5: timestamped clipboard log

Sometimes you want the audit trail, not the history. This appends every text copy to a dated log file:

#Requires AutoHotkey v2.0
OnClipboardChange(LogClip)
LogClip(DataType) {
    if DataType = 1 {
        FileAppend(FormatTime(, "yyyy-MM-dd HH:mm") . " | " . A_Clipboard . "`r`n`r`n",
            A_ScriptDir . "\cliplog.txt")
    }
}

Researchers and support staff use this to reconstruct "what did I copy during that session." Treat the log as sensitive: it is your clipboard in a file. The privacy hygiene for clipboard records is in How to Pause Clipboard Capture When You're Copying Secrets.

Debugging scripts that touch the clipboard

Three rules that save hours. First, ClipWait after any scripted copy: without it the script reads the clipboard before the copy lands and processes stale text. Second, test with plain text before images and files; format handling is where scripts break. Third, remember that assigning A_Clipboard inside an OnClipboardChange callback retriggers the callback. Guard with a flag variable or you get infinite recursion.

Where the scripts come from

Beyond one-off scripts, the ecosystem has full clipboard programs written in AutoHotkey. The awesome-AutoHotkey list has a Clipboard section with CL3, Clipjump, and ClipBoardMonitor. Know their status before adopting: Clipjump was popular and was abandoned in 2016 (it was later reimplemented from scratch in C# as PasteJump). Abandoned does not mean broken, but it means no fixes when Windows changes underneath it.

AutoHotkey vs a dedicated clipboard manager

Scripts and managers solve different halves of the problem.

Choose AutoHotkey when the job is a transformation: paste as plain text, clean text on copy, append instead of replace, remap chords. No manager exposes that level of control, and a script is exact.

Choose a dedicated manager when the job is retrieval: finding a string from Tuesday, previewing images, pinning boilerplate, searching thousands of clips. Ditto is the keyboard-first answer (Ditto vs CopyQ in 2026). CopyQ is the answer when the clipboard should run code. Edge-Drop is the answer when the job is visual staging and drag-out (Edge-Drop vs Ditto: Hover Shelf or Tray History?).

The honest middle: run both. Let a manager keep history and let a ten-line script handle the one transform you do fifty times a day. They do not conflict as long as only one of them writes to the clipboard on every copy. The conflict rules are in Can You Run Two Clipboard Tools at Once.

Related reading

Sources

  • AutoHotkey v2 docs: A_Clipboard (set, empty, plain-text conversion, append): https://www.autohotkey.com/docs/v2/lib/A_Clipboard.htm
  • AutoHotkey v2 docs: ClipboardAll (save/restore entire clipboard): https://www.autohotkey.com/docs/v2/lib/ClipboardAll.htm
  • xypha/AHK-v2-scripts on GitHub (MultiClip: 25-slot clipboard array via OnClipboardChange): https://github.com/xypha/AHK-v2-scripts
  • awesome-AutoHotkey, Clipboard script section (CL3, Clipjump, ClipBoardMonitor): https://github.com/rainbot-ch/awesome-AutoHotkey
  • PasteJump launch notes (Clipjump abandoned 2016, reimplemented in C#): https://github.com/lokeshgovindu/pastejump/blob/HEAD/docs/launch/README.md
Deepender Yadav
Written by Deepender Yadav · Author & Developer

Deepender Yadav is a B.Tech Computer Science Engineering student and software developer interested in building practical software and open-source projects.

GitHub · LinkedIn

Copy. Stack. Drop.

Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.

Download for Windows Get from Microsoft Store

How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge-Drop vs Win+V · Support

Free · Lightweight · Privacy First
Find us on CodeHype