This week I created a new system for organizing my story files. The problem? It’s nine folders large. If I had to create nine folders for every story I started, this system would die an early death. But it’s a good system. So I went to work trying to automate it.
Because I am a novice command-line wizard I was able to construct a very long command that created the nine folders, but there were a few things I couldn’t hack together, so I turned to the elder wizards. First, let me explain the system.
It’s all pretty self-explanatory. The last two are probably the exception. PubMaterial is for final copy, links to the article or post online, and screenshots of the published work. RefMaterial is for anything that is not reporting notes or a data file (reports, articles pulled from the internet, scanned documents).

There’s one other thing that you don’t see up there. I work with lots of data. Often I have the data before I have a story. Often I create stories around a spreadsheet or database file I’ve acquired. The first thing I do when I get a new data file or collection of files is create a text document called DataJournal that is always organized into the same four headings (so why not automate that, too?)
I wanted to be able to create this document when I created the folders. I had no idea how to do that, so I turned to Stack Overflow. In fewer than 30 minutes I had three solutions, each one a bit more powerful than the last. You can read the thread here, or you can just read on.
The shell script that changed everything, or something
So here’s how this idea evolved through the good people who offered their help over at Stack Overflow: Now I can create the folder tree right where I want it, and with the DataJournal file included, with a single short command. What’s more, I can name the folder in the command, which keeps me from creating and being stuck with a ton of folders called “NewStory” because I’m too lazy to rename them.
Here’s how it’s done…
1) Open a blank text file and paste this into it:
#!/bin/bash
if [[ -z "${1}" ]]; then
die "FolderName Required"
fi
/bin/mkdir -p ~/Desktop/$1/{Copy,Data,Notes,PubMaterial,RefMaterial,Media/{Audio,Images,Video}}
echo -n "---Data Folder Setup
---Data Introduction
---Data Audit/Manipulation
---Data Queries" > ~/Desktop/$1/Data/DataJournal.txt
2) Save save the file in your home folder (or wherever you please) as “create-story.sh”
3) Find your way to the command-line and make the file executable:
chmod +x create-story.sh
4) Now make the magic happen:
bash create-story.sh StoryName
That’s where you name your story folder, right there where it says “StoryName.”
This gives you my DataJournal file, which you may not want. Just stick with everything before the “echo” command if you don’t need the file. Or mess around a bit and put your own custom text file in one of the folders.
5) Set the path to whatever works for you. I actually send mine to a parent “Stories” folder on Dropbox, so I can get at this stuff anywhere. Just remember to change the path in both places it appears in the shell script.
I’m still playing with this. What I’d like to be able to do now is add build on to the script and make it create a generic Google Doc draft file and put a symlink in the drafts folder (messing with GoogleCL right now to try and make this happen). Onward!