Reliable way to do something on shutdown?

Terry Judd terry.judd at
Wed Jun 19 03:11:56 EDT 2013

On 19/06/2013, at 04:31 PM, Paul D. DeRocco wrote:

>> From: J. Landman Gay
>> ShutdownRequest is sent when the user tries to quit. 
>> CloseStackRequest 
>> is sent when they try to close a window, like when they click on the 
>> close box.
> Handling closeStack, and calling shutdown if it's the main stack, seems to
> solve the problem. Just in case, I wrote the shutdown handler so that if
> it's called twice, nothing bad will happen, so that should be safe no matter
> how it works under OS X or Linux.

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"
         pass appleEvent
         pass appleEvent
   end switch
end appleEvent

> Now, if only someone knew the answer to my hilitedLine question. (Nudge,
> nudge.)

Not sure what's going on there. Have you tried an opencard handler? Or tried using a 'send' to trigger the change?


> -- 
> Ciao,               Paul D. DeRocco
> Paul                mailto:pderocco at 
> _______________________________________________
> use-livecode mailing list
> use-livecode at
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:

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