[TxMt] Req: Compare docs-Diff

Allan Odgaard allan at macromates.com
Sat Feb 19 05:28:25 UTC 2005

On Feb 18, 2005, at 20:18, Eric Hsu wrote:

> 1. In my setup, a command of
>> echo $TM_SELECTED_FILES | xargs diff -u
> works but
>> diff -u  $TM_SELECTED_FILES
> does not. I get a "diff: file not found" error.

I think the problem is that the shell passes the variable as a single 
argument to diff. So basically in #2 it calls: diff -u "'file1' 
'file2'". I am however not entirely sure about this.

You can btw make #1 like this:
    xargs <<<$TM_SELECTED_FILES diff -u

>> osascript -e 'tell app "TextMate.app" to return path of every window'
> which seemed like the right thing to do, but gave me a
>> 34:38: execution error: TextMate got an error: 
>> NSCannotCreateScriptCommandError (10)
> Any thoughts?

The window doesn't have a path attribute. You can do:
    osascript -e 'tell app "TextMate.app" to return name of every window'

But probably not very helpful. To get the path I think one is supposed 
to go through the document of each window, but TextMate is unlikely to 
support this (since I do not use NSDocument).

More information about the textmate mailing list