I'm using TextMate to keep my daily log book - I have a 'Journal' template, language and snippets and it all works very nicely.
What I'd really like is that when I create a new file from the template, it immediately gets a filename based on the date - eg. 060418.txt - so I don't have to enter that manually when I go to save it.
The template creates the new file in the usual way, by copying some standard contents to $TM_NEW_FILE. I was hoping that I might then be able to call osascript and do something like
tell application "TextMate" to save the document of front window in "060418.txt"
but it doesn't seem to work.
Any suggestions most welcome!
On 18/4/2006, at 11:57, Quentin Stafford-Fraser wrote:
[...] What I'd really like is that when I create a new file from the template, it immediately gets a filename based on the date - eg. 060418.txt [...]
Maybe instead of using the template facility (which doesn’t provide you much) create the file by other means (e.g. script started from Quicksilver, a regular command), and have the creation script end with: mate «file created».
Ah - thanks, Allan -
That's a much better idea! And it avoids all that messing about with nasty, nasty AppleScript...!
Quentin