Reducing the Friction: BBEdit to MarsEdit

In some of the presentations that I give on productivity and efficiency, one of the things I mention is reducing the friction; that is, making processes more streamlined so they’re easier to perform. In this post, I’m going to describe one way I reduced the friction for producing and publishing blog posts using BBEdit, TextSoap, MarsEdit, and some AppleScript.

It’s no secret that I’ve become a huge fan of Markdown, the human-readable plain text “markup” format created by Jon Gruber. The vast majority of all my content is now created in Markdown, and then converted to RTF (to share with my Office-using co-workers), PDF (for broader publication), or HTML (for publishing online). Until very recently, my blog publishing process looked something like this:

  1. Write the blog post in Markdown, using TextMate.
  2. Using a built-in Markdown binary in TextMate, convert the Markdown into HTML.
  3. Run the raw HTML through TextSoap (very handy tool) to remove smart quotes and curly apostrophes.
  4. Paste the parsed HTML into MarsEdit for publication to my blog.

While it seems complicated, it wasn’t terribly complicated—but it wasn’t as seamless as it could be. So, I set out to improve the process. The first big change was a switch from TextMate to BBEdit, which is more extensible (and kept up to date by the developer). That change allowed me to do two things:

  • Switch from the built-in Markdown support in TextMate to using a separate (and more up-to-date) MultiMarkdown binary maintained by Fletcher Penny.
  • Introduce an AppleScript (BBEdit has outstanding support for AppleScript) to automate some portion of the process.

My first pass at automating the process just got me back to where I was before—writing Markdown in BBEdit, converting to HTML, cleaning the HTML with TextSoap, and pasting into MarsEdit. Not too impressive, but acceptable, and a process with which I was familiar. I stuck with that process for a while, primarily because it was a known entity. A couple of days ago, though, I asked myself: Can I do better? Can I be more efficient?

So, my second pass at automating the process is much more comprehensive. The AppleScript I wrote as a result of challenging myself to reduce the friction does the following:

  • Takes the Markdown from BBEdit and converts it to HTML.
  • Using the HTML produced by the standalone MultiMarkdown binary, it then calls TextSoap to (in the background) clean the HTML according to a custom cleaner I’d created (the custom cleaner, called “Replace HTML Entities,” just replaces curly quotes and curly apostrophes, which don’t translate well on my site).
  • Creates a new, blank blog post in MarsEdit, into which it pastes the cleaned HTML as the body of the post.

I store the script in BBEdit’s scripts folder, which means I can invoke the script easily from within BBEdit.

Here’s the AppleScript itself (click here if the script doesn’t show up):

Now, I can write my Markdown in BBEdit, invoke the script, and get dropped out to HTML code sitting in a new blog post in MarsEdit. All I need to do to publish the post at that point is supply the metadata (tags, categories, title, excerpt) and click Send to Blog. Done. (I used this process for this post, in fact.) How’s that for reduced friction?

Tags: , , ,

  1. Aaron Paxson’s avatar

    So, the only reason for dropping TextMate is for the apple-script support? I’ve not used BBEdit, so I’m trying to figure out if it’s worth it.

    I do like how MMD is built-in to TextMate, and the keyboard shortcuts make it easy for me to add/use resource links.

  2. slowe’s avatar

    Aaron, the AppleScript support isn’t the only reason for switching away from TextMate. I felt like TextMate was on the long, slow decline to obscurity—the developer had been promising v2 for years, then finally just open sourced the project. I really wanted an application where I knew the developer was going to back it up and give it regular updates. I’m not saying BBEdit is for everyone, nor am I saying that TextMate should be dropped…but it was the right decision for me.

  3. EtherealMind’s avatar

    FWIW, I’ve tended to perform the Markdown-HTML conversion directly in MarsEdit. I’ve found the Markdown support to be very good and, combined with the local preview using my own CSS, it reduces my friction.

    I prefer to write in MultiMarkdown Composer or Folding Text and then copy over to MarsEdit for publishing. I suspect that you are choosing BBEdit as your preferred method for writing text including coding etc.

  4. phocean’s avatar

    Scott,

    As a sidenote, you may be interested by this app:
    http://www.notebooksapp.com/

    It actually has buit-in most of the workflow you describe: take notes in mardown, then convert it with a single click in the menu to html, pdf, rtf…
    It has dropbox synchronization and support for iphone, ipad, mac, windows.

    It switched from Evernote and it has changed my life. I love markdown too and this excellent app is doing it right.

  5. slowe’s avatar

    Greg, thanks for your comment. You are correct that I use BBEdit for more than just writing Markdown; I also use it for all my text editing needs (writing Puppet manifests, editing config files, etc.).

  6. slowe’s avatar

    Phocean, thanks for the pointer to Notebooks; it looks like an interesting app. Not sure that I’ll switch, but it’s always nice to have additional options in case the existing workflow & tools aren’t working out.