Interactive Templates for TextMate
Note: This post is over 2 years old. You may want to check later in this blog to see if there is new information.
The following links are auto-generated but may help you locate newer content:
I’ve devised an interactive templating bundle for TextMate. I still don’t have a great grasp on Interface Builder, but enough to scrap together other people’s work and make a decent form or menu out of it. But I do have enough grasp of Ruby to do something cool with it.
What I’ve put together is a bundle that contains a template that, rather than the usual shell commands, contains a Ruby script that opens a nib. The nib will return a set of values, any values, that the script will process into a plist and use to replace values in your template. In the template file attached to the template, you just insert variables in the form :::key::: wherever you want to replace them with the returned values in your template. As an example in the bundle, I’ve included a simple mad lib that asks for 2 nouns, an adjective and a verb and then reconfigures them in a couple of different ways and outputs a text file.
Getting more complex, this is what I used to create the templates for the Circle Six Design site. Yesterday’s post showed what that nib looks like. All you really have to do is copy the existing nib and add your text fields, setting the Value->Model Key Path to the name of the key you want returned. Then use that key in your template and you’re set.
Feel free to download it and try it out, improve on it and send it back, or just laugh at me for trying. It’s out there for the taking.
Download: TemplateMaker.tmbundle.zip

Comments are closed
Comments are currently closed on this entry.