Skip to content

Instantly share code, notes, and snippets.

@martinandersen3d
Last active January 8, 2021 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinandersen3d/37fa72cfecf41639290e66266e25c45f to your computer and use it in GitHub Desktop.
Save martinandersen3d/37fa72cfecf41639290e66266e25c45f to your computer and use it in GitHub Desktop.
CopyQ Export CLI commandline - How to export all tabs to .txt files
# CopyQ - How to export ALL you tabs from copyq to text files!
# Use Powershell for the export
# CopyQ Help, with command: copyq help | Write-Output
# https://copyq.readthedocs.io/en/latest/command-line.html
# http://manpages.ubuntu.com/manpages/bionic/man1/copyq.1.html
# -------------------------------------------------------
# STEP 1. List the availible tabs with command:
copyq tab | Write-Output
# -------------------------------------------------------
# STEP 2. open "Windows Powershell ISE", create a new "CopyQ_Export.ps1" file. Copy/Paste the content below
# Replace the output from step 1 with the names, that my tabs where called
$exportTab = @(
'Bash Info',
'Bash File',
'Bash Folder',
'Bash Utils',
'Choco',
'Git Commit',
'Git Branch',
'Git Diff',
'Git Log',
'Git Merge',
'Git Remote',
'Git Reset',
'Laravel Cmd',
'Npm',
'Regex',
'Vue',
'MySql'
)
foreach ($i in $exportTab) {
copyq eval -- "tab('$i'); for(i=size(); i>0; --i) print(str(read(i-1)) + '\n');" | Write-Output > "$i.txt"
}
# -------------------------------------------------------
# Final note: I'm half angry that I need to code, to get simple stuff out of a GUI program!
@martinandersen3d
Copy link
Author

2021-01-08 00_49_14-StrokesPlus

image

image

@martinandersen3d
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment