Quick Tip: Paste A Uuid With Text Expander

I often like to get a UUID, a "universally unique identifier" for tagging things like receipts. In general, I add the UUID to a picture of a receipt or invoice in Evernote, then add the same to whatever accounting/Google Doc I'm using to track expenses. There is a great website to get a UUID:

http://www.famkruithof.net/uuid/uuidgen

However, before today I had to do this:

  1. Open a browser… (UGHHHHH!)
  2. Type a URL… (Uhhhhhhhhhhhhgggggg)
  3. Copy the UUID (Sigh…)
  4. Switch back to my application. (I want to die.)
  5. Paste it. (AHHHHHHH!!!)

Needless to say, this could not go on forever. Fortunately, one of my favorite apps Text Expander, can support shell scripts. So, it is kind of like having a command line "alias" for everything.

Now, whenever I type:

;uuid

It gets replaced with something like this:

8be746c0-9174-11e2-9e96-0800200c9a66

YES! (And because of the way Text Expander can be set up, it is still in the clipboard awaiting my next paste.)

You can do it too by adding this simple script to the snippet:

#!/bin/bash
curl -s http://www.famkruithof.net/uuid/uuidgen | grep -o '<h3>\([0-9a-z\-]\+\)</h3>' | sed 's/<h3>\(.*\)<\/h3>/\1/'

Enjoy.

If you enjoyed reading this or learned something, please consider sharing via , , or . Thanks!