Skip to content

Instantly share code, notes, and snippets.

@T-Rave
Last active June 1, 2023 20:53
Show Gist options
  • Save T-Rave/3400f876e0f4226a09681e069bf28a68 to your computer and use it in GitHub Desktop.
Save T-Rave/3400f876e0f4226a09681e069bf28a68 to your computer and use it in GitHub Desktop.
Alfred, Mac OS X app, full clipboard dump to text file
## Must have sqlite3 installed. Homebrew user? brew install sqlite
## Can be ran directly in command line and will place file directory where ran
## Remove `-header` if you don't want the output to have the column name `item`
## Checkout more options and Workflow - https://github.com/T-Rave/alfred-clipboard-dump
# dumps output with list option since single column. Produces cleaner data without double quotes
sqlite3 -header -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard;" > clipboard-dump.txt
# dumps full table to csv format
sqlite3 -header -csv ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT * FROM clipboard;" > clipboard-dump.csv
# dumps only items in descending (inverse) order with no column name
sqlite3 -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard ORDER BY item DESC;" > clipdump.txt
# To limit line output use `LIMIT n` in the `SELECT` statement. Example of outputing the first 5 items
sqlite3 -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard LIMIT 5;" > clipboard-dump.txt
# To limit output from last records up. Example of outputting the last 5 items
sqlite3 -list ~/Library/Application\ Support/Alfred\ 3/Databases/clipboard.alfdb "SELECT item FROM clipboard ORDER BY item DESC LIMIT 5;" > clipboard-dump.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment