Tips: An Alfred Workflow for Launching .scriv Files in Marked and Scrivener Simultaneously

(UPDATE Jan. 2017: A kind visitor recently let me know that the original workflow I created years ago, had stopped functioning properly. I’ve since fixed it and wrote a follow up post here).

A heads up: As the title implies, this post assumes (or, in a way, suggests) that you have purchased Scrivener, Marked and the Powerpack option in Alfred 2.

One of Scrivener’s shortcomings (yes, they do exist) as far as Markdown support is concerned, is its inability to give an HTML preview of your Markdown syntax while you write in it. There is no workflow for accomplishing this other than exporting your MD or MMD, opening it in another editor that reads MD (or the converted html) and checking it there before cutting and pasting the code into your blog’s editor.

In all fairness, that’s not what Scrivener was created to do and just because I’ve found some slightly unconventional uses for it, I can’t expect the good folks at Literature and Latte to change their software to accommodate lil ole me. We all know Scrivener is much, much bigger than blogging and writing in MD and MMD.

The good news is that even though Scrivener doesn’t have an in-app html preview function for your markdown, there is one program that you can use in tandem with it that can.

That Program is Marked.

You can read about Brett Terpstra’s “Marked” in a slew of different places (including its recommendation in the comments on this site ) so I won’t write a review of it here (maybe another time). In a nutshell though, Marked is a realtime markdown converter that works with any text editor you throw at it. Open a text file in its respective editor, open Marked, then drag the same file into Marked and go back to the text editor to continue writing/editing. As you save your markdown document, you’ll see it update in Marked, displaying the converted HTML instantly.

Cool right? It’s also a game-changer.

Marked and Scrivener

Integrating Marked has made my blogging workflow in Scrivener much more streamlined because of Marked’s handling of MD/MMD as well as its plethora of options and amazing tools for authors. But, that all said, getting a file into each application is clunky at best and almost immediately after doing that a couple of times, I wanted/needed to automate that initial step so that it was smoother.

Enter Alfred

Alfred is another popular tool out there whose sole function is to streamline everyday tasks like launching multiple apps at once, finding files quickly on your computer, searching the web, quitting apps, shutting down or restarting your computer… you get the idea. It does all of this from your keyboard and once you get used to its commands, you’ll get addicted to not touching a mouse or track pad. In truth, it’s one of the first apps I install when I get a new computer.

But aside from these baked-in options that you get for free, you can also pay for the Powerpack option and unlock a slew of very powerful tools that give you immense control over your Mac. One of these tools is the ability to easily create custom workflows. Once I encountered the dilemma above, I dove in and immediately came up with a solution.

Now, one caveat. I am not much of a programmer, so I made my workflow out of the built-in modules that Alfred gives you out of the box. I am sure that with some custom scripting this workflow could be made even nicer (if you have suggestions for improvements leave them in the comments below please). That all said, I was really happy with how this workflow came out. To save you (and I) some time I’ve included a link to the workflow below, so that you can download it and add it to your own personal workflows in Alfred. Just download it, double-click and add it to Alfred. Easy.

The way the workflow works is you bring up your Alfred prompt. Type in the keyword, which in my case is “scrivmarked”, that then allows you to browse your “Documents” directory right in Alfred. Once you find the .scriv file you want to open, arrow down to highlight it and hit the right arrow key where you’ll find a file action to open the file in both Scrivener and Marked, arrow down to that action and hit enter.

AlfredFileAction

Make it Your Own

One of the best things about workflows In Alfred is that you can tweak them to suit your needs relatively easily. Hate my keyword? Choose a different one. Have your Scrivener project files in a different location outside of the Documents directory in OS X? No problem, tweak the search scope. These, and many other aspects of workflows, can be tweaked easily in Alfred without knowing a single line of code.

But, again, if you do know a way to make this better, I’d love it if you posted your modifications in the comments below! I am sure there are many ways to make this workflow even more useful to us all!

Useful links:

Writing and Tips: Creating a Custom Project Template in Scrivener

One of the most requested posts I’ve seen in the comments section of this site has been for me to do a write-up on how to create a custom project template in Scrivener. It’s something I honestly had never thought of doing until I started blogging in Scrivener using Markdown and MultiMarkdown. After using that system for a bit, I realized quickly that I’d want the exact same setup for the next year (and the year after that). Without a template, I’d have to recreate everything in that project layout from scratch.

It was the first time I’d encountered a situation in Scrivener where I needed the initial layout of a project (folders, metadata, doc templates, etc…), to be a repeatable affair. Sure it’s easy enough to start a new project and recreate everything (easy, yet time-consuming), but wouldn’t it be great if I had a boilerplate starting point that did it all for me?

Luckily, as always, Scrivener makes creating such a setup quite easy.

One and done.

At first, I thought I’d use a previous project that was ideal for my needs and create a template from that. Good idea right? But then I realized that when you create project template in Scrivener, it takes literally everything in that project and adds it to the template.

In short, I’d get the bits I needed, but I’d spend even more time deleting the stuff I didn’t.

So, to avoid that situation, you need to to start a new project with zero content in it (I used Scrivener’s blank template). From here, you need to recreate only the skeletal structure of the elements that you are going to reuse moving forward. In the case of my blogging system, I only wanted the basic structural elements that I knew I’d need year after year. So that meant the folders for the months, useful, but generic meta-data, a doc template with pre-filled Markdown in it that I use in every post, and anything else that I’d recreate next year.

Once you have all of that set up, it’s time to create your template!

File > Save As Template… not File > Save As…

I remember striking out initially, while looking for this option under the “Save As…” and “Export” sub-menus under “File”. But I quickly saw the magical “Save As Template…” option and all was well.

Save As Template

Once you have your template structure in order. Head up to “File” and then look four options up from the bottom to find “Save As Template…”. Go ahead and click that.

This brings up a “Template Information” window where you can name your template, give it a description, assign an existing Scrivener category to it and even give it fancy custom icon so that it stands out the next time you create a new project.

Choosing A Custom Icon

Once that’s all sorted, click the “Ok” button and you’re done. Easy peasy.

Now you can either save the boilerplate project to add to it later or, if you feel confident that you nailed it on the first try, you can delete it. Don’t worry. You won’t lose your work. The template is safe and sound in Scrivener’s “Application Support” folder on your hard drive.

Let’s Take It For a Spin!

New Template

Now all you have to do to use your new template is start a new project in Scrivener. Select the category you assigned to it and choose your custom template. Once the new project comes up, you’ll see all of that beautiful time you just saved!

Prefilled Layout

Now go have a tall libation. You’ve earned it! :)

Tips: Setting up Scrivener to Compile MultiMarkdown

Back in August I wrote a post about using Literature and Latte’sScrivener as a complete Blogging System“. What I wasn’t expecting was how that post drummed up a lot conversation about MultiMarkdown and writing in Markdown in general. After going back and forth with you all (a genuine pleasure), I realized that I hadn’t really covered the process of exporting your MMD documents from Scrivener into clean, valid html for whatever web-based platform you were using.

I thought I’d take care of that now and write a companion piece on both setting up Scrivener to use Fletcher Penney’s MultiMarkDown and, once installed, how to easily compile your documents and export them as clean html that you can then copy and paste into the WYSWYG of your preferred blogging platform.

First, let’s get MultiMarkdown installed (if you don’t have it installed already)…

Markdown Export

One thing I failed to mention in that original post was that you actually may not have MultiMarkdown installed on your computer. I say this, because I didn’t. The easiest way to tell (without using the command line)? Open Scrivener, click the Compile button and hit the drop down at the bottom. If you see just “MultiMarkdown” as an option and nothing else, you don’t have everything you need to compile your MMD document into html.

Here’s what you need to do (don’t worry, it’s easy I promise):

  1. Go to Fletcher Penney’s MultiMarkdown downloads page and grab the install that matches the OS you are using on the computer in front of you. I usually download to my desktop to find it easier.
  2. Unzip the file that downloads and double-click the installer within.
  3. Follow the onscreen directions to complete the install.

That’s it! Told you it was easy.

What now?

If you had Scrivener open prior to the download, save your project and quit. Now re-open Scrivener and you should now see a whole new host of MultiMarkdown options under the drop down at the bottom of the “Compile” menu!

mmdoptionsinscrivener

For most of you, the “MultiMarkdown -> Web Page (.html)” option is all you need. Click that and then click the “Compile” button. Again, I like to save the exported .html doc to my desktop to find it easily, but feel free save the document wherever you like and open it in a text editor. To do this, right-click your new .html file and choose an editor like Textmate, Coda or even good old Notepad. Once open, you’ll see that all of your MultiMarkdown has now changed from this:

mmdcode

To this:

ScrivMMDExport

The code you are interested in (unless your working with a static HTML-based site) is within the opening and closing body tags (<body></body>). Copy that code and post it into your site’s editor. When you do this, make sure you are in HTML mode in your site’s editor (in WordPress it’s under the “Text” tab), otherwise you’ll end up with a post contains all of your text as well as all of the html tags. Trust me, it looks funny and broken when you do it.

Hey, this is great! Thanks! But what’s the point to all of this?

Well, put simply, WYSIWYG editors have come a long way over the years, but they are still far from perfect.

If you’ve ever written a post, pasted it into the editor of your site and spent the next hour cleaning up code the editor thought you wanted, you probably wouldn’t want to write on your web site again for a while. On the flip side though, these same web site editors will just about always take clean and valid html code and render it correctly – displaying everything just as you’d expect. Still, trying to write in html (not to mention valid html) is a pain in the butt too – we shouldn’t have to frankly – and, luckily, with Markdown we don’t have to.

That’s why it’s so damn convenient that Scrivener supports it!

What this post didn’t cover. (aka: I smell a series comin’ on!)

I didn’t go over actually writing in Markdown.

I am assuming if you read this far, you already know how to write in Markdown (which lends easily into MultiMarkdown) and that wasn’t really the point of the this post anyways.

If there is interest, I’d be happy to write another post on how I write in, and rely intrinsically on, Markdown for all of my web publishing. If you’d like to hear more, leave any specifics in the comments below (even if it’s just a “Yes please!”) and I will do my best to accommodate them in a future post.

Hope you found this useful! Now get back to blogging in Scrivener!

Writing: Scrivener as a complete Blogging System

About a month after I used Scrivener to finally finish a novel I started years ago, I got the idea of trying to use it as not only a staging area for posts here on my blog, but also as an infrastructure and archive of it as well. My system is admittedly quite basic, but I thought I would share it as it’s become critical and amazingly helpful since I’ve set it up. I figured the more basic it is now, the easier it would be for you all to adopt; modifying it to fit your needs.

Here goes…

Each Project is a Year

Project Year

Start a new project in Scrivener (File > New Project or shift-command-N on the Mac), choose a project template (whatever you are used to), and change the title to the year you are writing in. I originally thought I would call it “Posts” but, for me anyways, it quickly became too unwieldy and chaotic. I wanted this system to be simple yet powerful, not muddied with years of content.

Each Month is a Folder

Folder Month

I chose to break my posts into months but it would be just as easy to make each folder a site topic or category. I personally like months because I can generally remember about when chronologically I wrote a post. Also, if I search my blog and find it, it makes the post that much easier to find in my Scrivener project.

This is also a great opportunity to shift to corkboard view and add notes to each month so that you can either see what you wrote about at a glance, or maybe attach a note about a life event that occurred that effected your writing at the time. It’s up to you (obviously). Sometimes I don’t add anything, but I am glad I have the option when I do.

Believe it or not, this is the core structure of my blog writing system in Scrivener – a project is a year, a month is a folder.  Once this is set up, open the month you are currently in and create a new document.

Each Document is a Post

Document Posts

Here’s where your writing comes in. You can keep it simple and write the entirety of your post, save it, and then copy and paste the text into your blog of choice. Or you also have the opportunity to leverage Scrivener to its fullest! A lot of folks use Scrivener for short and long form writing and they should, there’s nothing out there that is better for that. But one of Scrivener’s secret weapons is its ability to export MultiMarkDown into clean and precise html. Which is perfect for a blog’s built-in text editor.

If you are familiar with markdown syntax, it’s a huge shortcut for exporting your writing easily into perfectly formatted html code (what your browser reads and translates into a web page). If you are interested in learning it, you can find everything you need to know right here. The learning curve is far from steep and it could save you a ton of time going forward.

*UPDATE* 09/27/13 – If you are interested in getting Scrivener setup to export MMD markup, I posted a companion piece to this post walking you through how to do so.  You’ll find it right here.

Markdown Export

Of course if you are not into learning that kind of stuff, that’s cool too. You don’t have to. A lot of blogging platforms handle copy and pasting text from word processors into their WYSIWYG editors quite well now, parsing your pasted text into HTML the best that it can. Still, the clean code that Markdown generates eliminates a lot of guess-work (and potential html clean up when a blog editor translates your text incorrectly) and I am immensely grateful that the kind folks at Literature and Latte had the foresight to see a need for it from their customers.

Ok, enough about my love of markdown! There are other tools you can leverage that cater very nicely to blogging. Many of these I am sure you are already familiar with, but I figured I’d hit them anyways.

Word Targets

Word Target

When I blog I like to set a word count target. Generally in Scrivener this is a goal for you to strive for, but with blogging it’s particularly great to know when you should start wrapping things up or stop completely and jump into edit mode. I like to think of it as the warning track on a baseball field giving you a heads up before your run head-long into a wall, or in the case of blogging, becoming too verbose.

Synopsis and Document Notes

Synopsis Notes

I often like to use the coveted right column in Scrivener to add notes, reference external links/topics, or even other posts that this post is linked to on my blog… just about anything else that is useful to you the author, but not necessary for your readership.

It’s a little extra work for you, but helpful at-a-glance down the road.

Corkboard View For Your Posts

corkboard view

This is something that, once you use it, you are always giving yourself a high-five in the future for doing so. I can’t tell you how many times this view in Scrivener has saved me from digging into pages and pages of text to find that one post that I wrote about topic “X”.

On each card, I add the date it was posted and a very brief synopsis. Make it part of your workflow, you will not regret it.

ProTip – if you do utilize Scrivener’s right column and fill out the synopsis field, the cork board view uses that text as the content displayed on the card.

Meta-Data

metadata

I may be getting a little too much “in the weeds” on this one but, I thought I’d throw it out there nonetheless. As you add more and more posts, you may want to consider assigning meta-data or “tags” to the content you produce. This will help organize your content a lot more efficiently and make it all infinitely more searchable in the future.

Start with broad topics and then hone in from there.

Many of you won’t need this, but Scrivener does such a bang-up job of its implementation of it, I thought I’d mention it.

What You End Up With

As with my long-form writing, Scrivener provides me with a one-stop-shop writing platform for my blog. If it could actually export to my blog (WordPress), that would be amazing! But don’t let that tiny quibble keep you from trying this idea out. With a little bit of groundwork applied up front, you get all of your writing organized and searchable, post by post, month by month, year by year.

One last perk? Exporting a project and getting an entire year’s worth of posts in pdf or epub format. Flipping through a retrospective of the last 365 days of your creative life is surprisingly satisfying to view on a tablet or even printed out if you want to feel the literal weight of your work.

Sort of like a yearbook for your blog! Only without the awkward interactions of asking for classmates to sign it. ;)

Writing: a System I Used to Write a 508 Page Novel…

This last spring I finally finished the first draft on a NaNoWriMo novel I started back in November, 2011. Spanning several years, computers and locations, I thought I’d share the software/hardware system I used for writing it.

The Software:

highres-scrivener-logo

It’s quite simple really (with a few twists), I used Literature and Latte’s Scrivener for almost all of it. Scrivener’s superior handling of MASSIVE documents in tiny chunks (in my case, chapters divided up into individual scenes) is solely responsible for me completing this novel. Period. The ability to manipulate your manuscript on a modular level – dragging and dropping individual chunks to where ever you see fit – completely changed the way that I write long and short form documents.

But it doesn’t even come close to stopping there! Nope, no way! There’s also a place in the app for character descriptions, corkboards for resources, images, notes; anything really. Word and page counts (along with goals), a mind-blowing set of preferences, full screen modes, support for several different coding languages (!?), a character name generator, the ability to add inspirational pictures as backgrounds whilst in full screen mode… the list is genuinely exhausting (in a good way) and I haven’t even brought up the various ways you can export your manuscript once you are done with it (epub, Kindle, pdf, MS Word, rich text, plain text, you name it and Scrivener can export to it)!

highres-3screens

Scrivener’s main strength however has always been in the way that it easily gets out of your way and lets you write. Sure, you can do everything I mentioned above (and WAY more), but you also don’t have to at all. It’s as complex or as simple as you want it to be. It easily and elegantly adapts to you and your workflows. It simply enables you to write.

highres-literature_and_latte-logo

A lot of care clearly went into the making of this software and you can see this attention to detail when you use it.

highres-scapple-logo

For the more complexly layered scenes I also used L&L’s mind-mapping software Scapple. I’ve already written an overview about this software on this very site in the past, so I won’t reiterate it but I will say that if you have any scene that contains a lot of moving parts, I can’t recommend Scapple enough. It really succeeds in getting your thoughts and moments organized and in order. I formed the climax of my novel entirely in Scapple before I wrote it. Because of this, writing it wasn’t nearly the herculean task I thought it was going to be. Sure, working the scene up in Scapple was additional work on top of everything else, but in the end it was absolutely worth it and that scene was much, much better for it.

Add in Scapple’s drag and drop compatibility with Scrivener and you’ve got a one-two punch that’s hard to beat.

highres-paper_to_digital

Those two programs alone did about 90% of the heavy lifting, the rest spanned across two iOS text editors that I took notes, or wrote a few scenes in. In those instances I used Agile Tortoise’s “Drafts” and Second Gear’s “Elements 2”, both of which I have mentioned and written about several times here on this site. What can I say! When I love something, I like to write about it! With the syncing capabilities of these apps, I was able to transfer scenes, notes, outlines, etc… very easily and in plain text/markdown, to where ever I needed them (mostly Dropbox, where I also stored a periodic back-up of the entire manuscript). They played a small role, but were vital to the process nonetheless.

Hardware used:

The novel at any given time could be found on a 7 year old iMac, a Mac Mini and a retina Macbook Pro when I worked through OSX. A small portion of it was written on a 3rd gen iPad with a bluetooth keyboard.

Other tidbits:

  • Music-wise, I wrote this book almost entirely while listening to Trent Reznor and Atticus Ross’ “The Social Network” and “The Girl With The Dragon Tattoo” soundtracks. It was a work of science fiction and those soundtracks suited the scenes in my head so well that they never got old. They are a good length too, so you know when to take a break when one finishes.
  • When I originally was writing I was compiling weekly .epub’s so that my wife Melinda could read along, but she caught up too quickly and I couldn’t write fast enough so I eventually stopped. She loved the process (and the story) though.
  • I finished the final scene on an Amtrak train heading back home to Durham from Charlotte. I certainly hadn’t planned it that way, but that’s how it happened. Trains here in the states are rarely used when compared to other forms of transportation, so it was a pretty cool and unexpected moment.

***All images in this post were supplied from Literature and Latte’s Press Kits for Scapple and Scrivener***