Save or Backup Clipboard History Switcher?

Hi, Everyone.

I've been searching the forum and the Interwebs looking for an answer to this question:

Is there a way to save all the contents of the Clipboard History Switcher to a file or folder on the hard drive?

There are two reasons I'm trying to figure this out:

1 - There is a signicant lag when using KM and the CHS on my macBook Pro 15" (no issues with lag on the mac Mini). The thought was that if I could save the CHS to a file or folder, then I could empty/delete the content of the CHS to reduce lag when activating it.

2 - I currently use another clipboard manager called Paste. I like it, it works well, and syncs via iCloud (CloudKit Sync). As good as both apps are, I don't want or need to keep two different apps open or running in the background for the same activity or function, in this case saving the clipboard history.

KM's CHS doesn't have a sync function, so whatever I copy on my mac mini goes into the clipboard history switcher and stays local. My other Mac (macBook Pro) has no idea what was copied and pasted.

By exporting the CHS content, I could then put it all into a shared iCloud, Amazon, Google Drives, or Dropbox folder, the CHS content would show up on my other devices. This assumes that there would be an import function to load up other CHS' content into the "local" KM instance. Pretty sure syncing Clipboard History Switchers doesn't exist today.

If this has been discussed before, please forgive the ask. I wasn't able to find an answer anywhere in the forum. Having a less elegant, "poor man's version" sync of multiple Macs, using cloud services would work in a pinch.

Until then, I'll keep using Paste, and keep my fingers crossed that CHS syncing will be here on day.

Thanks in advance for any suggestions you might have.

:v:t2:, :heart: & :hugs:,


P.S. - Does anyone know if the contents of the Clipboard History Switcher are saved or cached on the hard drive? If yes, where could I find it?

Hi @goswh,

You can change how many recodes the CHS keeps:

I also had lag before. After reducing the history to 50 or so, the lag was gone.

I don't have an elegant solution for it, but I think you can do something like:

While the clipboard is not empty:
    append/prepend the current clipboard to file,
    delete the current clipboard.

KM has all these three actions.

~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Clipboard History.kmchunked

I don't think Keyboard Maestro can detect what kind of data is on the clipboard, so writing out the appropriate file types might be a bit difficult.

You can figure out what's on there with AppleScript though:

set clipInfo to clipboard info
set AppleScript's text item delimiters to linefeed
return clipInfo as text

There's also some JXA and maybe some AppleScriptObjC code for that somewhere on the forum if you want to search for it.


Oh! Yes!

This is exactly what I was looking for!

Thanks so much!

1 Like