Now that's only clearing two types of event. I picked on them because they trap attempts to cancel a script, which was appropriate to the context. However, it's quite possible for other events to begin banking up, especially mouse movements, so it might be worthwhile adding NSMouseMovedMask in there too.
There is, in fact, a catch-all NSAnyEventMask, and in an ideal world, that's what I'd suggest. The problem is that it's an integer value beyond AppleScript's integer range, which means it gets converted to a real and doesn't work.
In Brian's case he might be better to use the Myriad Helpers equivalent, where it's defined as the -fordEvent method in the ObjectWithFords class. It should be quicker because it's done in Objective-C, but more importantly it uses NSAnyEventMask. So he'd define a property to hold an instance, and initialize it early:
set my notStan to current application's ObjectWithFords
And from then on he'd call it like this:
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden