[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp/Applescript question



At  1:23 PM 6/9/94 -0400, Henry Lieberman wrote:
>...
>What we want to do is have an Apple Script program send an Apple Event
>to Lisp. Specifically, we want to use the Eval Server in
>ccl:examples;eval-server.lisp to receive events.  So we need to
>send an Apple Event of type eval along with a string to eval.
>Tom Bonura suggested use of the "on" command but that does not seem
>to be right.
>

Here is a bit of applescript which tells Lisp to print "Hi there" on the
listener:

You can compile it as an appleScript applet and run and, provided the eval
server is running in MCL, it will execute the format statement:

        set s to "(format t " &  ascii character of 34 & "Hi There" & ascii
character of 34  & ")"

        tell application "MCL" to do script s

The method which I mentioned to you previously involving the "on" syntax
works for sending a raw appleevent of arbitrary type to some application
which does not support scripting ( but does support the event).  The "do
script" construct translates into an appleevent of type 'dosc' and should
be convenient for your needs.

>Note that Lisp does not have an aete resource, so is not "scriptable".
>Maybe it should?
>

In a sense the eval-server code makes MCL scriptable in that it will
execute any string which comes over in the direct param of an appleevent of
type dosc.  It really isn't scriptable of course, in the AppleEvent sense -
I'm not sure what terminology LISP would care to define (other than eval of
course).

An open question is: if one built an application in MCL, defined the
application's terminology (in an AETE) and built the appropriate event
handlers, AETEResolve callbacks, would scripting then work?  I've never
tried this - anyone else?


         Tom
....................................
              Tom Bonura
Apple Computer, Inc.   Advanced Technology Group,
        Interactive Media Lab
    Intelligent Systems Program
MS 301-3S, 1 Infinite Loop, Cupertino, CA 95104
Phone: (408)974-4538  Fax: (408)974-8414
....................................