This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: convert selected images | |
import "@johnlindquist/kit"; | |
// Grab selected files | |
const files = (await getSelectedFile()).split("\n"); | |
// Set up whitelist of formats | |
const supportedFormats = [".heic", ".png", ".gif", ".webp", ".jpg", ".jpeg"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Merge / Split Alfred clipboard | |
// Description: Merge or split clipboard content using Alfred app's clipboard | |
import "@johnlindquist/kit" | |
const Database = await npm("better-sqlite3"); | |
const databasePath = home('Library/Application Support/Alfred/Databases/clipboard.alfdb') | |
if (!await pathExists(databasePath)) { | |
notify("Alfred clipboard database not found" ) | |
exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Type Clipboard | |
// Description: Get the content of the clipboard and "keystroke" it without pasting | |
// Shortcut: ctrl+cmd+alt+shift+v | |
import "@johnlindquist/kit" | |
const clipboardText = await clipboard.readText() | |
if (clipboardText.length > 1000) { | |
await notify("Clipboard content is too long") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Open in WhatsApp | |
import "@johnlindquist/kit" | |
//get the text from the clipboard | |
let text = await clipboard.readText(); | |
//normalize the text | |
text = text.replace(/[-() ]/g, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: convert selected images | |
import "@johnlindquist/kit"; | |
// Grab selected files | |
const files = (await getSelectedFile()).split("\n"); | |
// Set up whitelist of formats | |
const supportedFormats = [".heic", ".png", ".gif", ".webp", ".jpg", ".jpeg"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Open URL in clipboard | |
import "@johnlindquist/kit" | |
//get the clipboard | |
let text = await clipboard.readText(); | |
//get the first URL in the clipboard, if any | |
let url = text.match(/(https?:\/\/[^\s]+)/); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Emoji Search | |
// Description: Search and copy emoji to clipboard using SQLite database | |
import "@johnlindquist/kit" | |
const Database = await npm("better-sqlite3") | |
const databaseFile = projectPath("db", "emoji-search-emojilib.db") | |
const emojilibURL = "https://raw.githubusercontent.com/muan/emojilib/main/dist/emoji-en-US.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Text Manipulation | |
// Description: Transform clipboard text based on user-selected options | |
import "@johnlindquist/kit" | |
let transformations = { | |
upperCase: text => text.toUpperCase(), | |
lowerCase: text => text.toLowerCase(), | |
capitalize: text => text.split('\n').map(line => line.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')).join('\n'), | |
decodeUrl: text => text.split('\n').map(line => decodeURIComponent(line)).join('\n'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: OCR | |
// Description: Capture a screenshot and recognize the text using tesseract.js | |
import "@johnlindquist/kit"; | |
//both win and linux implementations were created by chatgpt (gpt4), without _any_ tests!! 😅 | |
const captureScreenshot = async () => { | |
const tmpFile = `/tmp/screenshot-${Date.now()}.png`; | |
if (isMac) { |