• 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: Spinning Pizza Wheel. Why?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spinning Pizza Wheel. Why?


  • Subject: Re: Spinning Pizza Wheel. Why?
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 27 Mar 2015 09:52:21 +1100

On 27 Mar 2015, at 5:40 am, Stan Cleveland <email@hidden> wrote:

You mean Shane's handler. This isn't the first time he (Shane Stanley) and I (Stan Cleveland) have been mistaken for one another. 

I'm usually mistaken for someone much worse ;-)

On the subject of that handler, in my book it's like this:

on doEventFetch()
repeat
set theEvent to current application's NSApp's nextEventMatchingMask:(((current application's NSLeftMouseDownMask) as integer) + ((current application's NSKeyDownMask) as integer)) untilDate:(missing value) inMode:(current application's NSEventTrackingRunLoopMode) dequeue:true
if theEvent is missing value then
exit repeat
else
current application's NSApp's sendEvent:theEvent
end if
end repeat
end doEventFetch

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:

notStan's fordEvent()

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Follow-Ups:
    • Re: Spinning Pizza Wheel. Why?
      • From: Brian Christmas <email@hidden>
References: 
 >Spinning Pizza Wheel. Why? (From: Brian Christmas <email@hidden>)
 >Re: Spinning Pizza Wheel. Why? (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Spinning Pizza Wheel. Why?
  • Next by Date: Re: Spinning Pizza Wheel. Why?
  • Previous by thread: Re: Spinning Pizza Wheel. Why?
  • Next by thread: Re: Spinning Pizza Wheel. Why?
  • Index(es):
    • Date
    • Thread