• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: generic event handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generic event handlers


  • Subject: Re: generic event handlers
  • From: Chris Nebel <email@hidden>
  • Date: Wed, 14 Feb 2001 13:46:51 -0800
  • Organization: Apple Computer, Inc.

David Oberst wrote:

> I have an Applescript applet which has "on <event XXXXyyyy>" handlers for a
> few custom Apple Events, which I use as a simulation tester for the actual
> program that handles them. I can't seem to find any way to create a
> "generic" event handler, so that I could do something like "on <event
> XXXX****>" to handle all events in the "XXXX" class.
>
> Without it I have to keep Applescript up to date with changes in the real
> program, so that it handles all the same events.
>
> Even syntax for a handler for "otherwise unhandled events" would be useful.
> Was I dreaming that I thought that Applescript could do this?

Apple Events can do this sort of thing, but AppleScript can't. While it's
possible to define a handler for a raw event code, AppleScript always does an
exact match of the code you supply with no wildcard interpretation. If you
were willing to write your own applet shell, you could arrange for otherwise
unhandled events to be sent to a special handler in the script, but that might
be more work than you want to deal with.


--Chris Nebel
AppleScript Engineering


References: 
 >generic event handlers (From: David Oberst <email@hidden>)

  • Prev by Date: Re: Accessing a Record by variable--the solutions
  • Next by Date: Re: how can I automatically compile a script?
  • Previous by thread: generic event handlers
  • Next by thread: Re: Can I script create an applet
  • Index(es):
    • Date
    • Thread