Three changes.
I fixed the -w flag to await the closing of the editing window without any RETURN prompt. I stole the code from Marcin's otheraccount@verizon.net recent script. (What is Marcin's last name?)
I added a -t flag like bbedit, so you can name the piped input.
I also added the ability to pass a -u flag so filenames are treated as URLs. It then uses curl to decipher/download the filenames and passes the results to TM. Unfortunately, this only works for anonymous FTP and not most FTP/SFTP setups. I'm sure someone enterprising could do it, but it doesn't seem worth it unless TM saves files back to S/FTP. On the other hand, bbedit doesn't handle http at all! :)
Here is the current help file.
TextMate Command Line Tool usage: tm [-chtuw] filename [filename ...]
This tool opens files, directories, URLs or (with no filenames) standard input.
-c Create a new file. -h Show this help. -t Specify a title for piped input. Overrides other flags. -u Treat filenames as URLs (e.g. tm -u www.google.com). Uses curl. -w Waits for the edited file window to close before ending (for
external editing)
Here is (from what I can tell) lacking in comparison to bbedit.
- jump to line number (probably you'd want to use a command with output parsing anyway... see e.g. Perl>PerlErrors) - print (probably needs some Applescript... Marcin?) - FTP/SFTP (prob need support from TM itself)
The latest script is still at http://macromates.com/svn/Bundles/trunk/Scripts/tm.
best wishes, Eric