Reliable way to do something on shutdown?

Terry Judd terry.judd at unimelb.edu.au
Wed Jun 19 15:57:08 EDT 2013


On 20/06/2013, at 02:45 AM, J. Landman Gay wrote:

> On 6/19/13 2:11 AM, Terry Judd wrote:
> 
>> One more thing - if you have a special clean up routine then you'll need to handle the user quitting using a keyboard shortcut (cmd-Q) separately on OSX. Something like this...
>> 
>> on appleEvent pClass,pID,pSender
>>    switch (pClass & pID)
>>       case "aevtquit"
>>          myShutdownRoutine
>>          pass appleEvent
>>          break
>>       default
>>          pass appleEvent
>>          break
>>    end switch
>> end appleEvent
> 
> Just curious why you'd need an AppleEvent. Wouldn't a shutdown handler be enough? I've never had to use an AppleEvent for that, but would like to know what situation would require it.


No, you're right. I was under the impression that cmd-q didn't trigger a shutdown request message. Perhaps it didn't in the distant past and I never registered the change.

Terry...

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne








More information about the use-livecode mailing list