From: Jon G. <jg...@hi...> - 2002-03-05 22:01:32
|
At 11:31 AM -0800 3/5/02, Jim Ingham wrote: >Tcl does not support AppleEvents, it doesn't have a Carbon Event >loop, and is pretty much a straight Unix command-line app. Wish >responds to the required suite of AppleEvents, plus a "do script" >Apple Event which holds a string as the direct object. This string >is just "eval-ed" in the running interpreter. > >The do script event is what you want. TclAE is another option, giving more access to AppleEvents in all=20 their hideous glory, but your Tcl app has to be addressable. Loaded=20 into Alpha, TclAE responds to AppleEvents just fine. It should work=20 in Wish, too, but Aqua Wish 8.4a4 won't load TclAE. I tried an=20 interesting little experiment though: Welcome to Darwin! [dogbert:~] guyer% tclsh % package require tclAE 2.0 % proc hdlr {args} {puts $args} % tclAE::installEventHandler FOOO BAAR hdlr % tclAE::send -s FOOO BAAR ---- 2 tclAEDesc.1 tclAEDesc.2 % proc hdlr {evt rpl} {puts [tclAE::print $evt]; puts [tclAE::print $rpl]= } % tclAE::send -s FOOO BAAR ---- 2 FOOO\BAAR{'----':2, &addr:psn (=AB0000000000000002=BB)} 'null'() So, tclsh is capable of receiving AppleEvents sent to "self", but I=20 can't figure out how to target it from another app (Terminal.app=20 isn't it). --=20 Jonathan E. Guyer <http://www.his.com/jguyer/> |