Using TextExpander for Markdown Reference Links

Patrick Rhone (from MinimalMac) did his first screencast this week about creating a Text Expander snippet for Markdown links. Like Patrick, I write everything in Markdown (although I use the MultiMarkdown
variant), which lets me export to nearly any format and write on the iPhone, iPad, and Mac without friction. I wrote the whole book in MultiMarkdown.*

Anyway, Patrick’s video got me thinking. Patrick puts his links right next to the linked words. I use Markdown’s reference links. The advantage of using referenced links is that the text is much easier to read. You can also use the same reference more than once. Reference links can be set anywhere in the document. Some folks do it at the end of the paragraph. I do them all at the bottom.

The syntax for reference links in Markdown works as follows:

First you type some [Link Text][Reference]
Then more text … yadda yadda yadda
[Reference]:Web URL

The Link Text is the text that shows up on the page. The Reference is an index. It can be a number or words. The Web URL is the link you are pointing toward. Here is concrete example.

This is one [nerdy Mac site.][1]
Really, the guy just won’t shut up.
[1]:https://www.macsparky.com/

So I decided to take a page from Patrick’s playbook and create my own TextExpander snippet to create referenced links. It’s not that hard.

Snippet Walkthrough

If you are thinking ahead while you write, you can do this all in one step. This snippet, upon activation, asks you to insert the Link Text and Reference and then creates a Reference entry on the next line using the Web link from your clipboard. Finally, it puts the cursor back at the end of your link text. Fire up TextExpander and follow along.

Create a new snippet and start with two sets of brackets. The first will hold the Link Text and the second will hold the Reference. The Snippet should now look like this:

— Begin Snippet Code —
[][]
— End Snippet Code —

Next, create a Fill-In blank for the Link Text. These are blanks that Text Expander will prompt you to fill when the snippet runs. To create a Fill-In blank, insert the cursor between the first two brackets and select Fill-In from the Cursor drop down shown below.

— Begin Snippet Code —
[%fill:name%][]
— End Snippet Code —

Next, create a second Fill-In blank in the second set of brackets. This will be the blank for the Reference. When you create this second FIll-In blank, change the text from fill:name to fill:reference. This name is a variable. If you use the same name twice, TextExpander will copy it into both places. You will use this later.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
— End Snippet Code —

Next you’ll create the reference. First add a few carriage returns and then create the reference syntax, which is a pair of brackets and a colon.

    — Begin Snippet Code —
[%fill:name%][%fill:reference%]
[]:
— End Snippet Code —

Add a Fill-In blank in the brackets and rename it fill:reference. This duplicates the reference used above so you only need to type it once.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
[%fill:reference%]:
— End Snippet Code —

Next, add the Web URL. Place the cursor after the colon and select the Clipboard option from the cursor drop down shown in the figure below. This step dumps your clipboard in as a link. In order to make this work, you must first select and copy the link you want to use before activating the snippet. (You can do this in Safari by navigating to the desired page, pressing Command-L and then Command-C.) Alternatively, you could also make this a Fill-In field and type the URL in manually.

— Begin Snippet Code —
[%fill:name%][%fill:reference%]
[%fill:reference%]:%clipboard
— End Snippet Code —

Finally, move the cursor back to the top line at the end of the link and select Position Cursor Here from the Cursor menu. This resets the cursor back in your text so you can continue typing.

— Begin Snippet Code —
[%fill:name%][%fill:reference%] %|
[%fill:reference%]:%clipboard
— End Snippet Code —

I named this snippet Markdown Link and use the keyboard combination .[ to set it off.

Here is a picture of it in action.

And here is the resulting code.

Link as Afterthought

The above workflow assumes you think of creating the link while you are typing. If you want to add a reference link later, I created two more snippets.

The first takes highlighted text in the body of your text and sets up the text and reference number. Here is the TextExpander snippet code. I use .] to activate this snippet.

— Begin Snippet Code —
[%clipboard][%fill:reference%]
— End Snippet Code —

The second snippet creates the reference link. I use .: for this one.

— Begin Snippet Code —
[%fill:reference%]:%clipboard
— End Snippet Code —

Are you a Markdown nerd and using TextExpander? Let me know or, better yet, leave a comment and describe it for everyone.

Home Screens – Ernie Svenson

One of the best new friendships I made at this year’s ABA TechShow, was Ernie Svenson (Twitter), a.k.a. Ernie the Attorney. Ernie is a New Orleans-based attorney as well as an established technology blogger and podcaster. Ernie is also a very charming guy and jazz aficionado.

So Ernie, what is on your home screen?

What are your most interesting home screen apps?

I like the Foodspotting app, which is in my ‘food’ folder. People take pictures of dishes at local restaurants and upload them to Foodspotting, so with the GPS ability of the iPhone you can find nearby eats based on delectable pictures. In New Orleans I find this to very helpful because there are so many great places to eat.

What is your favorite app?

I LOVE the Siri app. It is the perfect example of advanced technology being indistinguishable from magic. I can’t believe how easy it is to find local businesses and then call them. Dragon Dictation and Shazam are probably on equal footing in the same way.

Which app is your guilty pleasure?

Words with Friends, no doubt. I don’t like to play games, but this is Scrabble in a way that enhances social connections.  No one seems to have time to play a real game of Scrabble but almost everyone I know has been playing Words with Friends and loves it.  

How many screens have you filled?

Before the folders feature arrived it was 9 screens, but now I’ve got it down to a manageable 4 screens.  I’m a sucker for the promise of a new app, but I find that there are only about 15 apps that I rely on regularly.

What is the app you are still missing?

I really don’t think I’m missing anything.  I’m amazed at the apps that I would never even have thought were possible. I used to have a guitar tuner, but I found an app that does the same thing and just as well as a dedicated tuner. So I got rid of that. I also no longer have a point-and-shoot camera. 

How many times a day do you use your iPhone?

I use it constantly for things like checking the weather, reading Twitter posts, searching for information, monitoring tasks, text messaging and of course phone calls.
 

What is your favorite feature of the iPhone?

I don’t use it every day, but I love the feature that lets me hold down the home button and then tell my phone to call someone or to play one of my iTunes playlists. Once again: total magic.
 

If you were Steve Jobs, what would you add to the iPhone?

A light saber laser for carving holiday turkeys.  

Anything else you’d like to share?

Just that, if folks don’t know about my friend Jeff Richardson’s excellent blog iPhoneJD.com, that they should check it out. Jeff does an outstanding job of covering useful apps for the iPhone.  The focus is on things that help lawyers, but most of what he talks about would be useful for anyone. 

Thanks Ernie!

Mac at Work, the Book

I’ve received several e-mails complaining about how posts have slowed down at MacSparky.com. I am finally able to explain why. A few years ago I realized that while a lot of people are carrying Macs to work, very few of these Mac workers are taking full advantage of the goodness that is OS X. So, I decided to write a book. After several fits and starts, I signed a contract with Wiley Press and have spent my nights and weekends for the last five months writing 90,000 words.

The book is called “Mac at Work.”

This project has been my passion for the last two years and I’m excited to finally share it.
The book is intended as a reference and filled with recommendations and workflows. It includes 24 chapters covering all of the most common topics you’ll run against when using your Mac to get work done. Each chapter is self-contained and intended as a reference on its particular subject. For instance, there’s a chapter on synchronizing your Mac with your office network. Likewise, there are chapters on running Windows on your Mac, managing PDF files, preparing presentations, and tackling e-mail. The list goes on; You get the idea.

The process of writing the book was my own nerdy epic adventure. For the first month I was convinced I’d be getting a call any moment from Wiley Press explaining they were very sorry but green lighting this book was obviously a big mistake. Thankfully, that call never came. I look forward to sharing the details of how I went about writing a book in future posts.

The book is now nearly done. It’s full-color and the layout is gorgeous. It will be in bookstores and the Apple iBookstore. The book is 350 pages (or thereabouts) and will release on January 17, 2011, a week before Macworld. It will go up on Amazon before that and you can trust that I’ll have links here when that happens.

There is no other book like this. As a result, the publisher wanted me to stay quiet until now. Looking forward, completion of the book means that I’ll be able to devote more attention to MacSparky.com. If you are a Mac worker or know a Mac worker, stay tuned for more details.

In Praise of OpenDNS

If you haven’t already, you really should set up OpenDNS on your home network. This free service provides a way to automatically block pornography, malicious Web content, and track stats on your Internet access. I have two young girls in my house and even innocent Google searches sometimes turn up the strangest things. I sleep easier knowing I have OpenDNS on the job. Check it out. To learn more about OpenDNS, listen to the extended coverage on Mac Power Users DNS episode.

Ristretto for iPad Review

Since my iPad first arrived, my poor MacBook has been increasingly neglected. The iPad goes with me everywhere. So the iPad needs a bag. Not just a bag for the iPad but one that can also hold the stand, the bluetooth keyboard, and the other bits and pieces; A throw it over your shoulder, get-some-work-done bag.

Apparently I’m not the only one looking for such a bag because there are a lot of them out there. I received a Tom Bihn Ristretto for iPad ($110) review bag and, after beating it up for six weeks, am reporting in.

The Bag

The Ristretto, made at the Tom Bihn Factory in Seattle, started life as a netbook grade computer bag. It is a vertical messenger bag with a built-in padded compartment for your iPad. Empty, the bag measures 12” x 9.25” x 4.75”. As a matter of coincidence it is perfect for the iPad and an Apple Bluetooth keyboard.

The bag has an inner compartment that contains a large bay, a zippered compartment, several smaller pockets, and the iPad compartment. It is all covered with an asymmetrical flap and sturdy plastic buckle.

The padded compartment is made with quarter inch open-cell foam laminated with durable 4 Ply Taslan® on the outside, and features an interior of brushed nylon. The foam surrounds the iPad. There is a correct way to insert the iPad, with the glass facing in and the aluminum facing the back of the bag. Once you put your iPad in the padded compartment, there is a top flap that can fold over enclosing your Precious.

The large compartment is the perfect height for an Apple Bluetooth keyboard. It has three O-rings that you can use to attach your keys or optional pouches. It is also a good place for a pocket leatherman. The stock bag includes a key strap. The built in pockets are the right size to hold pens, a wallet, and an iPod. (Your phone is in your pocket, right?) There is a slanted open pocket on the back of the Ristretto. It is too small for papers (unless folded in half) but does prove handy for envelopes and mail.

The Ristretto ships with waist straps to secure it to your body. This works great for bicyclists. More importantly, the waist strap hardware unclips and disappears when not in use.

The Strap

The Ristretto ships with the standard shoulder strap, a 1.5” wide heavy nylon webbing strap with a foam pad. For an extra $20, you can upgrade to the Absolute Shoulder Strap. At first blush it seems kind of silly upgrading a strap on an iPad case but after using the Absolute Shoulder Strap for awhile, you’ll get it. The Absolute Shoulder Strap uses a neoprene pad with an all metal snaphook (see note below regarding The Squeak). If you carry the bag for any length of time, it is a lot more comfortable. I’ve also found myself repurposing The Absolute Shoulder Strap with all my various bags.

The Squeak

After using the bag for about a week I began to notice a subtle squeak when carrying it around. The source of the sound is the metal snaphook from the strap rubbing against the metal eyelit on the bag. The connectors are both metal. I used some silicon based bicycle chain lubricant and it went away. I spoke with Tom Bihn and they recommend rubbing a graphite pencil on the offending pieces. I tested their fix and it worked. Tom Bihn reports they are aware of this and are working on it.

Usage and Recommendation

I beat the hell out of this bag. Over the last six weeks I carried it through the Canadian wilderness and down the Las Vegas strip. Its been thrown in trunks, dragged by kids, and schlepped around everywhere with me. It still looks like new.

More importantly, it has performed just as advertised. The Ristretto is a great solution for the iPad and just a bit more. If you routinely use Apple’s Bluetooth keyboard, it’s perfect. I liked it so much, I bought another one for my wife.

A Note About the Pictures

All of the pictures in this review were taken after I spent 6 weeks usage.
Full size images are in my Flickr feed here.

Scrivener 2.0 Sneak Peaks

As we get closer to the release of Scrivener 2.0, additional details are coming out. I’ve been working with the beta and I’m looking forward to writing an extended review when the product is released. In the meantime, there is some good early coverage at Macworld and the developer released a YouTube video demonstrating one of my very favorite new features, synchronization between Scrivener and SimpleNote.

Initial Impression: Dragon Dictate for Mac

I just spent the day working with Dragon Dictate for Mac, the successor to MacSpeech Dictate. My initial impressions are all positive.

  • Implementation of the Dragon engine version 11 is fantastic. This thing is fast, really fast.
  • The commands are much more intuitive. They are also are consistent with Dragon Dictate on the PC.
  • You can now use multiple microphones on the same profile. While this isn’t a big deal for everyone, it is for me.

Dragon Dictate for Mac still trails behind the PC version but the gap is narrowing. It makes no sense anymore to load a Windows virtual machine to run Dragon Dictate for Windows. If you need to dictate to a Mac, just get Dragon Dictate for Mac. I’ll do an in depth review later but for now, if you already use MacSpeech Dictate, the $50 upgrade is a no brainer.

ScanSnap + Hazel

I’ve been thinking about a workflow to automatically file documents with Hazel using highlighted terms since Fujitsu first added the ability to selectively apply optical character recognition. Brooks Duncan pulls it all together. As an aside, my not so scientific experimentation using the ScanSnap OCR features say green highlighters work best.

BusyCal 1.5 Beta

The new BusyCal public beta allows you to sync with the new MobileMe calendar beta and other CalDAV servers. It also includes the ability to sync over your local area network and Google calendar. I’ve been running it since last week with no troubles. I think, in the end, the transition to CalDAV is going to benefit everyone.