I'm new to TextMate and thinking of using it for teaching purposes. I would like to fill out a form and have TextMate to automatically create the needed file. For instance I have a snippet called csc (short for CreateStandardClass) that looks like this

Class: ${1:ClassName}
SubClassOf: ${2:Object}
InstanceVariables: ${3:varName1},${4:varName2}

After I've entered the needed info (Rectangle, width and height) it looks like this

ClassName: Rectangle
SubClassOf: Object
InstanceVariables: width,height

After entering height and pressing tab I would like TextMate to generate the Objective-C code below. (It should be possible since all needed data is in the variables $1, $2, $3 and $4)

// Rectangle.h
#import <objc/Object.h>
@interface  Rectangle: Object
{
    int    width;
    int    height;
}
-(void)    setWidth:(int) w;
-(void)    setHeight:(int) h;
-(int)    width;
-(int)    height;
@end


// Rectangle.m
#import "Rectangle.h"

@implementation Rectangle;
-(void)    setWidth:(int) w
{
    width=w;
}
-(void)    setHeight:(int) h
{
    height=h;
}
-(int)    width
{
    return width;
}
-(int)    height
{
    return height;
}
@end


Is there a way to do this?

Thanks Bob