Years ago (12!) I made a script called Planter that would generate directory and file structures based on an indented template. I decided to reimagine the whole thing and am happy to release Planter 3 today.
Instead of relying on a single template file, Planter now expects a template directory with all of the subdirectories and files you want to include already existing. To make this work, the template variable system has been completely reworked. It now supports named keys, prompts for values on the command line, and can even handle if/then logic and multiple choice variables.
Template variables can be applied to filenames (including if/then logic) and within any type of text-based file (including XML, RTF, JSON, etc., and Apple Binary PLIST will be converted automatically). This means you can template your source code, your notes, even your Mindnode mind maps, rich text notes, and Scrivener documents.
I’m not going to document the whole thing here, as I’ve written a pretty good README for the project. If this is of interest to you, let me know about anything that’s confusing in the documentation.
I will note that because of its interactive nature on the command line, it’s a bit more difficult to incorporate into something like a LaunchBar or Alfred workflow. But not impossible, as values can be passed as arguments, so if your automation handles the interaction for filling in the variables, you can easily call the script. It’s also now a Ruby gem, which means you can’t easily embed the whole script and would have to rely on it being installed on the user’s system.
If you regularly create projects that follow a similar directory/file structure, Planter will save you a ton of time. Check it out.
If you have ideas or need support, please use the Forum. I look forward to hearing from you!