Using Dropbox as a synced clipboard for text snippets

It’s hard to keep your clipboard synced between devices these days. There are only a few apps able to do this properly and even those have their misdemeanors. I couldn’t stand Paster Plus for more than a few minutes and I heard that CloudClipboard also falls short on a few features. The best clipboard manager available is Pastebot and it hasn’t been updated in ages.

Most of my articles are written on the Mac, however, most of the content comes from the iPhone, therefore, having a quick method to send actions from one device to the other is essential to speed up my workflow. On, @kleerkoat and I discussed about a way to get synced snippets between devices, the trick is that he is on Windows, so none of the aforementioned apps were useful. So I created a simple workflow using Launch Center Pro and Drafts to solve this problem.

The first step was creating a file named clipboard.txt at the root folder of my Dropbox. This whole scheme would be useless if I didn’t have a way to quickly include new text to this file. A tiny Drafts action fixes that, prepending the string to the same clipboard.txt file whenever I have something to sync.

Now we need to grab the top line of text from this Dropbox text file and copy it to the clipboard. We gonna use a LCP action to grab the text and send to Drafts:

Copy Synced Clipboard:

drafts://x-callback-url/create?text=[dropbox-text:clipboard.txt]&action={{Sync Clipboard}}

This action will grab the whole content of our clipboard.txt, place it on a new Drafts document and call an action named Sync Clipboard, which looks like this:

Sync Clipboard:

drafts://x-callback-url/create?text=[[title]]&action={{Copy to Clipboard}}

It creates a new draft using only the first line of clipboard.txt and calls the built-in Copy to Clipboard action. If your text has more than a single line, this action will only place the first paragraph on the clipboard. The coolest thing about this is that I can quickly pick my shared snippets using Launchbar. Also, you can still use x-callback-url to take the action further, for example, you can move to the text editor you’re using at the moment, like Byword or 1Writer.

For those in need to sync multiple lines, we gotta appeal to Pythonista. Since we can’t rely on line breaks to separate our items, we gotta change our prepend to synced clipboard action from Drafts to create a divider between each clip. For this action, which you can download here, I’ll use double em dashes (——), but you can generate a random string on 1Password and use it, doesn’t matter. Grabbing the first item from your clipboard files also requires a new LCP action, calling for our upcoming Pythonista script.

Sync Clipboard:


That’s really straightforward, so as our Pythonista script, which I call SyncClipboard.

# -*- coding: utf-8 -*-
import clipboard

board = sys.argv[1].split('——')


So short I wrote the code in an extra line just to make it look like it was more complicated. This script will only add the first item to the clipboard, you can also import the urllib and webbrowser modules to call for another action as we have done on many python scripts before. Happy copy-pasting.