i've written a few scripts to make editing of remote files easier. then i noticed that TM supports the "external editor protocol" (http://www.merzwaren.com/external_editor.html), which sounds like it would make some of my hacks quite a bit cleaner, but only if i was able to deal with applescript events. i haven't been able to find tools to make a ruby script (or any other scripting language) able to receive applescript events (yes, i know how to send them, although that's still ugly), which means (as far as i can tell) that i'd need to start mucking with obj-C...
but then it occurred to me that it ought to be easy for TM to support a more scripter-friendly version of the same protocol, e.g. mate --notify <path> <file>
would associate the script at <path> with the opened file, so that TM would make event callbacks, e.g.
<path> saved <file> <path> closed <file> <path> reopen <file>
given that you've already got the events-based version of the protocol implemented, it sounds like this should be pretty straightforward, and it sure would make my life easier...
(a more general request: please don't make useful TM functionality only available through applescript. there are a lot of scripting languages for OS X, and for all but one of them applescript events are a PITA. anything that can be done by sending applescript events should also be accessible via mate! thanks.)
On 26/1/2006, at 19:54, firstname.lastname@example.org wrote:
but then it occurred to me that it ought to be easy for TM to support a more scripter-friendly version of the same protocol, e.g. [...]
Have a look at stakeout: http://michael-mccracken.net/blog/blosxom.pl/ 2004/07/28
This will allow you to have your script notified when the file is saved (but not closed, for which there is mate -w).
As for receiving AppleScript events from a shell tool, that's not really possible AFAIK because the sender needs to have the receivers four character code, which is something only “real” applications have.