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 git.io.
-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.
- 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.
- Login to gist in the Terminal (
gist --login and enter your credentials.
- Press ↓↓ this button ↓↓.
The Jekyll Tag
I added a second Macro to the download where the url gets converted into a Jekyll tag.
- Enter your GitHub username in the first variable in the macro called
- 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).
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.
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.