[TxMt] Re: Remote editing

William Uther willu.mailingLists at cse.unsw.edu.au
Thu Oct 26 14:17:00 UTC 2006


On Thu, 26 Oct 2006 12:19:22, romain.guerout at stud.unibas.ch wrote:

> William Uther <willu.mailingLists at ...> writes:
>
>>
>> Hi all,
>>
>>    I just finished some scripts that allow remote editing with
>> TextMate, kinda like BBedit's sftp functionality.  They're a little
>> rough, but I thought I'd release them so that others can play if they
>> want.
>>
>> http://www.cse.unsw.edu.au/~willu/RemoteEdit/
>>
>> Cheers,
>>
>> Will         :-}
>
>
> It silently fails for me :-(. I type “mate file” on the  
> remote
> machine, it asks for my password on the Mac, keeping an eye
> on my net traffic, I see that the remote file is copied on my Mac
> but nothing happens…
> Is it possible to have more debugging outputs of some sort…
>
> TIA

I'll have a look this weekend.  Most of it is pretty simple though -  
you could probably add that debugging yourself if you know any shell  
script at all.  Here's a description of what is going on.

The 'mate' script runs on the remote machine.  It is a simple shell  
script that ssh's into your mac and runs the 'remoteOpen' script with  
the username on the remote machine, the hostname of the remote  
machine and the path to the file.

The 'remoteOpen' script scp's the file to the local machine.  Given  
that this is happening, you know this is being called with correct  
arguments.  Once it has scp'd the file across, this script calls  
'odbedit' on the local file (with '-s remoteOnEdit' arguments which  
tells odbedit to call the 'remoteOnEdit' script when the file is  
edited.  That script just scp's the file back to the remote machine).

I'm guessing this call to odbedit is what is failing.  odbedit is not  
a script, but is has pretty good debugging output on errors.  I  
suggest opening a shell on your mac, creating a text file, and  
running 'odbedit file' locally to see what happens.  The file should  
open in TextMate, and odbedit should block.  When you close the file  
in TextMate, odbedit should unblock and exit.

In more detail, odbedit will send an AppleEvent to ODBForwarder.app  
which will forward the AppleEvent to TextMate.  When Textmate saves  
or closes the file, it will send an AppleEvent back along the same  
path.  In order for odbedit to find ODBForwarder.app, you need to  
have shown the finder where ODBForwarder.app is - open the directory  
containing ODBForwarder.app in the finder.

odbedit will give errors to the stdout in the shell you ran it on.   
You can see the debugging output for ODBForwarder.app by running / 
Applications/Utilities/Console.app .  ODBForwarder.app will display a  
message there when it starts up, and will display any errors there.   
I can imagine two possible errors here:

  i) ODBForwarder.app cannot be found or started for some reason.  In  
this case I would expect to see an error message from odbedit, and  
you should not see the startup message from ODBForwarder.app on the  
console.
  ii) ODBForwarder.app cannot find its preferences file.  In this  
case it will default to sending its events to BBedit, which you  
probably don't have installed :).  This should show up as error  
messages on the console.  For more info on ODBForwarder.app and its  
preferences, see http://www.cse.unsw.edu.au/~willu/ODBSuite/ 
#ODBForwarder
  iii) ODBForwarder.app has found its preferences and is sending to  
TextMate, but for some reason the events are not getting through.   
This should also show up as error messages on the console.

   I'm not sure if the error messages are detailed enough to tell the  
difference between ii) and iii) by default.  Have a look and see what  
you get.

Hope that helps.  Let me know what happens :)

Will            :-}




More information about the textmate mailing list