Share clipboard with Dropbox

Dropbox is pretty good. Like anything, I wouldn’t trust it with everything important but it has features that make it more useful than just a synced folder.

One feature I like is being able to share the URL of something in your dropbox public folder easily. On a Mac you can right click a file in the folder and select “Copy Public Link”. You can then paste that link into a chat or e-mail or whatever.

It’s so useful I use it for stuff that isn’t even on dropbox already. I’ll copy something, paste it to a file, then move the file to dropbox and get the link. Screenshots is a particularly often used example. It’s so close to perfect for sharing things, it makes me want it to be just a little better to complete it. If there was a way to turn what’s in my clipboard into a dropbox URL without leaving the application I’m in, that would be perfect. I’m sure I could bridge that gap.

One of the coolest things about Mac OS that makes me surprised it hasn’t been adopted more by computer science types, is that pretty much every graphical application (even 3rd party) and system service can be scripted. It’s been going on since even before OS X and is called AppleScript. With little developer effort, objects and methods can be mapped to the scripting language. AppleScript is perfectly capable of accessing the clipboard, turning it into a file with the appropriate type, then putting that file somewhere. Dropbox public URLs are very simple, and are based on a user ID stored in a simple config file and the file name, so are easy to synthesise.

I made an AppleScript to do all that when run, and then packaged it as an Application. I can now use Spotlight (OS X’s system search, accessed with a key combination from any app), which prioritises applications to make them easy to launch, so I can now do this task within seconds without even needing the mouse.

I’ve made the application (which is its own source) available on GitHub at https://github.com/Riprock/Paste-Dropbox.

Icon copy

Proxy followup

When doing my work on the filtering proxy, I did think about whether it could be made to work with HTTPS as well. The only useful plain text part of a HTTPS connection is the domain, so that seems to be a limiting factor on what I could do, just block domains. Obviously the rest of the data going through the proxy would be encrypted, but as my computer was the sender and intended recipient, surely I could decrypt it. As it turns out, Chrome (not my go to browser) can be configured to output a file containing they keys it uses in HTTPS. I discovered while using wireshark on another project. Wireshark can use this file to let you inspect HTTPS streams. Maybe my proxy could be updated to use this file (and parallels in other browsers if they’re there) to allow filtering for HTTPS.