Link List – May 20, 2014

May 20, 2014

Link List – May 20, 2014 → by → via @_patrickwelker

Upload To Gist With Keyboard Maestro

May 18, 2014

Upload To Gist With Keyboard Maestro → via @_patrickwelker

I’ve been forgetting to add syntax highlighting in most of the scripts I posted here. Today I was working behind the scenes of RocketINK and styled the Gist embed function of Jekyll along with fine-tuning the normal Pygments code highlighting. Long story short, Gist rocks and you will see nicer code on this site in the future. And… of course I had to make things easier and build a Keyboard Maestro wrapper around the gist gem from Chris Wanstrath the co-founder of GitHub.

Here’s a screen shot of the non-Jekyll version:


You can read the content from a file and upload it or (the default) upload the current selection.

The macro goes through the options that come with the gist gem and appends the options to the final shell script. I didn’t include all options, only these ones:

-f, --filename [NAME.EXTENSION]  Sets the filename and syntax type.
-p, --private                    Makes your gist private.
-d, --description DESCRIPTION    Adds a description to your gist.
-s, --shorten                    Shorten the gist URL using
-c, --copy                       Copy the resulting URL to the clipboard
-o, --open                       Open the resulting URL in a browser
-P, --paste                      Paste from the clipboard to gist

In case you miss something (like uploading anonymous) you should be able to add it easily by copying an IF-block from the macro and modify the parameters.

There’s only three things you need to do to get this macro started.

  1. Download and install the Gist ruby gem. If you have homebrew installed brew install gist. If you don’t know what I’m talking about you probably should read this. Although this is an ImageMagick example, the basic steps are the same and there is some extra information.
  2. Login to gist in the Terminal (/Applications/Utilities/ gist --login and enter your credentials.
  3. Press ↓↓ this button ↓↓.


The Jekyll Tag

I added a second Macro to the download where the url gets converted into a Jekyll tag.

  1. Enter your GitHub username in the first variable in the macro called GIST__Username.
  2. Go to the AppleScript under “Guess used text editor” and in the second line replace all the editors with the ones you got installed:

If you have more than one of these editors open, the macro will prompt you to choose one. If none is open the macro aborts and gives you a notification. The normal URL link to the Gist still waits for you in your clipboard.

You can have a look at all the juicy details in this tall, tall screen shot (which also marks the end of this post).


Gathering Cites With An Audio Book, Drafts and Skim

May 17, 2014

Gathering Cites With An Audio Book, Drafts and Skim → via @_patrickwelker

Todays post isn’t a script and isn’t focusing on a particular app. It’s just a simple workflow I grew accustomed to while studying at University which helped me a lot writing all of my term papers and essays.

I’m currently working on a medium sized paper. Most things I have to write are about literature, and once I’ve found my topic and wrote down the outline, working closely with the text is my next goal. I regard finding good citations as the pillar of every solid thesis. So that’s what I do and my workflow evolves around making this easier for ‘people like me’.

With people like me I refer to those of you who, despite of standing one hundred percent behind the books they put in their bookshelves, have problems with reading swiftly through a tome. I hereby admit that I’m a slow reader. Slow like in, a snail would effortlessly beat me time-wise in reading a Siracusa review any day. I doubt that the snail would enjoy the read as much as me or even understand the deeper insights, but I have to give it to her that it’s quite cool to keep the own home always with one (and… to be capable of reading that fast).

However, luckily I’m also an audio book addict. So, the first thing I do when I have a project at hand is booting up the old computing machine and hunt down an unabridged audio book of whatever I’m suppose to read. For me the benefit is that I can multi-task while listing to an audio book. I can exercise, do chores, massage the misses, whatever….

Sometimes there is no audio book available. If that’s the case I proceed to step two and search for the eBook version of the book, Project Gutenberg usually is a good starting point. Until today I was able to get every book or text I had to read in digital form. And once it’s digital you can convert it to an audio book.

Okay, … you got me there. If there isn’t an audio book available which I can purchase, there’s a script I use involved. I use this one from Mac OS X Hints. Still, I prefer a professional narrator any day over Daniel, my default British accent OS X voice. As charming as he (or “Steffi”, the German voice) is, the joy of listening to a professionally produced audio book with a good narrator is one of my favorite things to do. Daniel can’t beat that.

My current target is one of the books I read at least five times: “The Magic Mountain” by one of my favorite authors, Thomas Mann. The audio book I own has a brilliant narrator which excels at putting live into the myriad of different characters and the digital text is the annotated edition in form of a PDF (I tend to convert all books to the PDF format because it’s part of my workflow).

So, this is the best starting condition I could wish for. What next? I start “listing really well”. If I’m writing about a book, it’s likely that I’ve already read or listened to it at least once. You may be familiar with the term close reading. This I exactly what I do with the audio book. The only kind of notes I take are a couple of keywords from the sentence can envision being a good match for my topic. When at home I put make these notes in a Markdown list in nvALT with the title of the book, c.f. “The Magic Mountain - Audio Notes”. But most times I use Drafts on my iPhone to send that entry to the text file for the corresponding book. From time to time I add additional comments to it with a simple syntax: >> comment to the keywords above. The last few days I got up at 6 am, did a 90 minute walk at the waterside and from time to time grabbed my iPhone a put some letters in Drafts. That’s all there is.

The next phase takes place on my Mac. I open up Skim, search for the keywords to find the passage I’m looking for and read it again. Then I create an anchored note with the cite that caught my attention. The first line in these notes consists of tags containing the keywords, key points of the cite and the characters who uttered them, for example “@hc @narrator @economy”. Here @HC resembles the initials of the hero and main character of the novel. The next line contains rough drafts of my own thoughts. Most of them I will rewrite and put to use in the paper.

For me working with a searchable PDF and jumping from keyword to keyword feels far superior to scribbling notes in a book. It’s also super easy to find a mentions of word and find new connections.

After I’m done with gathering cites I let Skitch export them in a text file and organize them in Scrivener by persons, motifs, places… in short, where they fit the best.

Writing the paper now feels like being able to cherry pick from the best cites, connecting points comes along quite effortless, too, thanks to Scrivener.

Last Words

I know this so-called workflow isn’t for everyone. Serious/professional readers might even shake their head in disbelief. My girlfriend constantly snickers when I tell her that I’ve finished another book, but some people tend to judge and you might even get a little hate. All I can say is, that in my book it doesn’t matter how you engage with literature, as long as you do it. Matter of fact, audio books can work as kind of a gateway drug to the heavier stuff in the shelves for all of those young folks out there who aren’t into books anymore.

Also, don’t get me wrong. I enjoy reading, the real reading that you do with your eyes not with your ears. My lame excuse for only reading one or two books a year narrows down to, that I read so many blog posts, RSS feeds and tweets on a daily basis that I’ve already got my reading fix. Listening to an audio book is when I can calm down and relax.

Carry on. Read a book. Be it one with letters on paper or bytes on digital component, be it consumed with your eyes, ears or hands.

Upload To Dropbox With Keyboard Maestro

May 15, 2014

Upload To Dropbox With Keyboard Maestro → via @_patrickwelker

If you like yesterdays post with the file uploading to CloudApp you will love this one. It’s a Keyboard Maestro macro which lets you upload files to Dropbox.


As yesterdays macro it comes with a small feature set:

  • It works with a selection of multiple files.
  • It supports Finder and Path Finder.
  • You can choose the folder you want to upload to. If you don’t it defaults to whatever directory you set as the default inside the macro.
  • You can choose to output direct links… which comes in handy if you just uploading some pictures (therefore I set it as the default). The standard Dropbox links might be a good choice if you’re uploading other file types, e.g. a zip package.
  • There’s also Droplet I build with the help of this script which executes our Keyboard Maestro script.

This macro currently doesn’t support folders (only files). If you’re interested in this leave some feedback and raise the chances of me trying to implement said feature.


(1) Download and install Andrea Fabrizi’s Dropbox-Uploader from

If you read Andrea’s installation instructions you know that using his bash script is secure, but… you also need to setup a Dropbox App so that you can use the script.

Go to App Console - Dropbox and create your app with the following settings:


Now head over to the bash file (you dutifully installed and made executable like Andrea told you to) and adjust the location of the config file. I just used the default settings:

#Default configuration file

I can’t remember right, but I think after the first run the script prompts you for your Dropbox developer information and stores everything away in the .dropbox_uploader file. This is the time when you enter your freshly acquired app key and secret.

(2) Download and install my macro.

Import (or double-click) the Upload Files to Dropbox.kmmacros macro. It will get placed in a group called “Finder/Path Finder” which is only available in said apps.

If you wish to use the Droplet, put the “Dropbox” where you like (how about the Applications directory?). You can add it to the Finder’s toolbar, use Dropzone or your favorite launcher to drag files onto it and upload them.

The Dropbox icon I used is from the Hand Stitch Social Iconset by DesignBolts.

After double clicking the helper macro (00)Helper for Droplet/ Upload Files to Dropbox.kmmacros), it gets installed into the “Global Macro Group”. This is a workaround since the AppleScript (living inside the Dropbox Uploader app) can’t execute our initial Keyboard Maestro macro because it is in a group that restricts access to Finder and Path Finder.

Don’t forget to configurate the two variables (below the comment titled “SETUP” in the macro). In addition, you have to exchange another variable inside the shell script which uploads to Dropbox (I forgot to add a variable at the top) – replace bin=~/Dropbox/bin with wherever your script is living.


That’s it… here comes a very tall screen shot with a lot of comments which marks the end of this post: