[TxMt] tying external action to actions in Textmate

Cliff Pruitt lists.cpruitt at cliffpruitt.com
Wed May 23 19:08:02 UTC 2007


On May 23, 2007, at 1:57 PM, Brooks Seymore wrote:

> Could this also be done through a Bundle Command, with the new  
> document created and the timer launched by running the command?
>
> B.

Yeah, you can trigger a Applescript when you run a bundle command or  
even include run it from the script used when creating a file from a  
template so creating a new file would start the timer, but then you  
wouldn't be able to log time if you were just editing existing files.

I haven't had time to look into it for myself, but does anyone else  
know if you can just use launchd to watch a TextMate related file for  
changes, say, the TextMates preferences for example?  If the file is  
modified you can assume you're working with TM & then start your  
timer?   I know launchd can monitor paths, but I don't know if TM  
alters its prefs file on disk when its running or just when it shuts  
down or what.  If so it'd maybe work to use launchd to watch the  
prefs file and run a script.  The script could even maybe use

	defaults read com.macromates.textmate NSRecentDocumentRecords

to examine what documents were last opened / saved and mess with your  
timer accordingly, though you'd have to translate them from alias  
references (or whatever the heck the prefs file stores) to paths  
somehow.  Thats beyond me at the moment.

I'm just tossing out ideas...

- Cliff




More information about the textmate mailing list