Script Kit Logo
Script Kit
by John Lindquist

Scripts by aldirrix

Clipboard history with image preview

aldirrix's avatar
Aldo Preciado
// Name: Clipboard history
// Author: Aldo Preciado
// GitHub: @aldirrix
// Shortcut: command shift v
import "@johnlindquist/kit";
const history = await getClipboardHistory();
let { value, type } = await arg("What to paste?", () => {
return history.map(({ value, type, timestamp, maybeSecret }) => {
const multilinePreview = value.includes("\n")
? `<div class="font-mono text-xs">${value
.split("\n")
.map((line) => `<p>${line}</p>`)
.join("")}<div>`
: null;
const preview = type === "image" ? `<img src="${value}" alt="${value}">` : multilinePreview;
21 lines below • View full script