[TxMt] newbie question about text snippets

jan at gocom.ca jan at gocom.ca
Tue Oct 30 01:11:28 UTC 2007


I am trying to find out how to insert an existing applescript into a 
snippet or perhaps a more elegant solution to inserting variables into 
snippets. Perhaps I need to explain:

I have many variations of boilerplate text that I use dozens of times 
during the day in my work that require a variable input in certain 
places. While I am not a programmer, I am all for automating repetitive 
tasks and I'm not afraid of a little scripting. A little. Some of the 
stuff in those bundles looked downright scary.

I was kindly directed to use the tab stops for snippets like this:

	________________________________________________

	Hello ${1:firstname}

	Thank you for your order for a ${2:product}
	________________________________________________

Perfect. Easy. The next part, though, is to give me more control over 
the values I am inserting.

For example, I have been using BBedit (which does the job but I don't 
particularly like) and in their "clippings" you can insert a 
placeholder that can call up an applescript to run. Even this is 
awkward compared to the simple way that NoteTabPro worked for me for 
10+ years in windows before I switched to a mac - I could create 
'clips' in it that would insert boilerplate text and at any 
placeholders, I could include dialog boxes to type in a value or choose 
it from a list. 

I sat here for 6 hours today trying to see how I can do this or 
something like it in TextMate - and I found programming languages that 
I will never use, and syntax for them that I am utterly stumped by. 

Can anyone help me?

Janet



More information about the textmate mailing list