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
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.