Creating new blog posts with an Alfred workflow

One of my favourite new features of Alfred v2 is the new Workflows framework. It allows you to chain together scripts and actions based on a trigger.

I’ve created a Workflow that makes creating a new blog post quick and easy. I use Kirby so all my blog posts are stored in text files. I can now open Alfred, type post followed by the slug of the post I want to create and it will automatically do the following:

  • create a new directory with a name generated from the slug and blog post number
  • create a post.txt file within the directory created above, populated with my blog post structure

My Alfred blog post workflow

It works by running the following bash script:

You can download the Workflow here.

Note: You’ll need to modify the blog path in the bash script.

Hopefully you find it useful. I’m no bash expert, so I’d to love to hear feedback or suggestions. I’m on Twitter: @marcjenkins.

Update (03/04/13): Matthew Guay has tweaked the Workflow above and added some extra features. Check out his post: Publish to Kirby from Alfred.

Published on
Tagged:

Related articles

Where to go next

1. If you'd like to discuss working together, I'd love to hear from you. Even if you don't have a specific project in mind, but would like to start the relationship for when you do, go introduce yourself.

2. If you enjoyed this article, why not share it on Twitter, Facebook or LinkedIn?

3. If you want to get my writing delivered to your inbox, subscribe to my newsletter. I only send out one email per month and you're free to unsubscribe at any time.

4. If you're on the socials, you can follow me on Twitter @marcjenkins or send a request on LinkedIn.