[TxMt] Re: Using mate command with templates

Hans-Jörg Bibiko bibiko at eva.mpg.de
Wed Jan 14 14:13:01 UTC 2009


On 14.01.2009, at 13:39, Hans-Jörg Bibiko wrote:

>
> On 14.01.2009, at 12:43, Arne Eilermann wrote:
>> is there a possibility to create an new file from template using the
>> mate terminal command?
> mate untitled.html;osascript -e "tell app \"TextMate\" to insert
> \"`cat ~/Desktop/template.txt`\" as snippet true"

Or simply make usage of this tiny shell command:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmate
Type: application/octet-stream
Size: 1197 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20090114/bf726e7e/attachment.obj>
-------------- next part --------------



Examples: (if tmate is saved in a folder found by $PATH)
tmate ~/Desktop/My\ template.html
tmate "$HOME/Desktop/My template.html"

or just

tmate

Hint: the escaping of double quotes inside of the template file is not  
necessary anymore. Will be done in the script.

--Hans




More information about the textmate mailing list