Clipboard special history, preview images as well

Open copy-to-clipboard in Script Kit

copy-to-clipboard.js

// Menu: Copy to Clipboard
// Description: Save to Clipboard history
// Shortcut: command shift c
import "@johnlindquist/kit"
let { write, history } = await db("clipboard-history", { history: [{ value: "", type: "", timestamp: "", secret: "" }] })
const clipboardVal = await clipboard.readText();
const newValue = {
value: clipboardVal,
timestamp: new Date(Date.now()).toLocaleString('en-GB', { timeZone: 'UTC' }),
secret: clipboardVal.includes('secret'),
type: /(http)?s?:?(\/\/[^"']*\.(?:png|jpg|jpeg|gif|png|svg))/i.test(clipboardVal) ? "image" : "text"
}
history.push(newValue)
await write()