Clipboard History joiner extension for Alfred

The Clipboard History in Alfred is a great thing and this extension try to use it for a common task: joining several piece of text copied from different sources.

Its use is simple… just have Clipboard History enabled in Alfred…

An example: you have to copy several pieces of code from an HTML file and they are not contiguos.
Just copy them in the sequence you prefer. They are stored in Alfred’s Clipboard History. Just remember the number of pieces you have copied. Let’s say you copied 3 pieces of code.

All you have to do is to invoke the extension with 3 as the {query} parameter

cj 3

Now you should have in your clipboard the 3 pieces of code joined (in the sequence you copied them) ready to be pasted where you want.

The extension takes care of removing from clipboard history the joined pieces, so if you have chosen the wrong number as a parameter you can try again.

Please don’t blame me for the ugly code, shell coding is not my job… Any suggestion or correction is really appreciated.

Perhaps this could be made in a cleaner way with a Plugin API, but in the meantime you can download the extension here

ATTENTION: this extension is experimental, it access directly Alfred’s  clipboard history db. I’ve tested it only on Leopard and it seems to work correctly. If something goes wrong maybe your clipboard history db may become corrupted.

PS: thanks to @jdfwarrior for his extensions… they are always a source of inspiration (and I’ve borrowed some lines of code from his work, mainly the way to find the path of current user home dir)

This entry was posted in OSX and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>