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

Re: [MacPerl] playing with Applescript



On Thu, 16 May 1996, Bart Lateur wrote:

> And for those people interested in extending MacPerl's capabilities in
> dealing with Apple-events, the tricky part: a script saved as an application
> does *not* have an aete or aeut resource. So, in order to be able to control
> server applets like these, you need more than just checking the aete resource.


One thing that is feasable is to name an AppleScript subroutine (or 
whatever it's called) with a name like:

on event <<signSIGN>>
        ...
end

If you give your applet a unique application signature, you could then 
send it an AppleEvent with AEBuild.

There is an example of this in the Internet Config 1.2 package. There is 
an applet in the goodies folder that does exactly what I exposed. An 
disguised AppleScript script receives an <<GURLGURL>> event and forwards 
it to Eudora, in the Eudora way. See that for the exact details...


It is probably feasable also to save a script as a resource, paste it in 
teh resource fork of a script, then use the resource calls of the MacPerl 
toolbox to load the script, and send it commands. This way, you wouldn't 
have to keep an application open at all times to do the job.

--
Guillaume Lessard           | "Violence is the last refuge of 
glessard@phy.ulaval.ca      |  the incompetent"    -- Isaac Asimov