Yup. It's not even my script or idea. When TextMate discontinued new-from-template I wrote to this very list, and that script was the solution provided.

In this snippet you can use backticks to execute commands and then use TM_MATE to set the language of the current document, for example make the snippet like this:

<!DOCTYPE html>`"$TM_MATE" &>/dev/null -t text.html.php &`
<html lang="da">
…

Allan, I'm chuffed there's finally a way to set the language without resorting to the AppleScript tell System Events-thing! I'll look into it tomorrow!

Thanks,

Rasmus


On 12/07/16 23.43, Matt Neuburg wrote:

      
On Jul 12, 2016, at 1:37 PM, Rasmus Malver <rasmus@malver.dk> wrote:

Since templates were discontinued I've been using this AppleScript to make a quick HTML doc:

I'm kind of amazed your script _ever_ worked. You're not even talking to TextMate. And I don't see anything that would make the template text appear in the document; you're just making a kind of "here doc". You're just sort of trusting that the "result" of your script will magically become the text of the document at the right moment.

m.

--
matt neuburg, phd = http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do
iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html


_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate