SixFive7/TextPaster

Tiny Windows utility that pastes a text file into the focused window, then puts your clipboard back. .NET Framework 4.8, 8 KB exe, nothing to install.

★ 0Forks 0C#GitHub ↗Compare
clipboarddotnethotkeypasteutilitywindows

README

TextPaster

Pastes a text file into the focused window in one go, then puts your clipboard back.

Hotkey tools that "type" text, such as the text macros in Logitech G HUB, send it one key at a time, which takes ages for anything longer than a sentence. TextPaster pastes it through the clipboard instead, so a page of text arrives at once, and your clipboard ends up the way you left it.

Usage

TextPaster.exe <text-file>

Bind that command to a key in your hotkey tool (for example a "Launch application" assignment in Logitech G HUB) and press it while the cursor is where the text should go. The file is read as UTF-8, and a trailing line break is dropped.

TextPaster.exe <text-file> /test

does everything except pressing Ctrl+V: it puts the text on the clipboard and waits for another program to read it. Handy for checking that it works.

What happens when you press the key

  1. It takes a copy of everything on the clipboard: text, images, files and any other format that can be read back.
  2. It puts the file's text on the clipboard and presses Ctrl+V.
  3. It keeps the clipboard in its own hands while it waits, so the window that pastes has to ask TextPaster for the text. That request is how it knows the paste happened.
  4. 200 ms after the last request it puts your previous clipboard back. If nothing asks within 3 seconds, it restores anyway.
  5. If you copied something else in the meantime, it leaves that alone.

The pasted text and the restore are both marked so Windows keeps them out of clipboard history (Win+V) and cloud clipboard sync.

It shows no window, does not keep running afterwards, and needs no installation or admin rights.

Log

Each run adds one line to %LOCALAPPDATA%\TextPaster\TextPaster.log, for example:

2026-10-01 12:00:00  read after 30 ms, restored after 232 ms

Requirements

Windows 10 or 11. TextPaster runs on .NET Framework 4.8, which is part of Windows.

Building

Run build.cmd. It uses the C# compiler that ships with .NET Framework 4.8 and writes bin\TextPaster.exe.

Prior art

Restoring the clipboard as soon as the target has read it, instead of after a fixed delay, is not a new idea. LibreAutomate has done it since at least 2021, and Handy added a very similar approach in 2026. KeePass and others use the clipboard history markers. TextPaster puts these ideas into one small standalone exe.

License

Functional Source License 1.1 (MIT Future License), modified to a five-year term. See LICENSE.

Contributors

SixFive7

Issues