Handling a system shutdown
Ken Ray
kray at sonsothunder.com
Thu Dec 12 10:46:01 EST 2002
You could try trapping for the "quit" appleevent (which I think is
"aevtquit" or "reqdquit"), as in:
on appleEvent pClass,pID
if pClass & pID = "aevtquit" then
-- your code here
else
pass appleEvent
end if
end appleEvent
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
----- Original Message -----
From: <depstein at att.net>
To: <metacard at lists.runrev.com>
Sent: Thursday, December 12, 2002 8:59 AM
Subject: Handling a system shutdown
> Handling a "shutDownRequest" message lets us interrupt the process of
Quitting
> Metacard in order to make sure things are properly saved. But on my Mac
OS9.2
> it does not appear that this message is generated if the user is in the
Finder
> and chooses "Shut Down" while Metacard is running in the background. Is
there
> any way to intercept this shutdown process--as most commercial programs
do--so
> that Metacard does not quit without giving the user a chance to save
unsaved
> changes?
>
> David Epstein
> > Send metacard mailing list submissions to
> > metacard at lists.runrev.com
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > http://lists.runrev.com/mailman/listinfo/metacard
> > or, via email, send a message with subject or body 'help' to
> > metacard-request at lists.runrev.com
> >
> > You can reach the person managing the list at
> > metacard-admin at lists.runrev.com
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of metacard digest..."
> >
> >
> > This is the Metacard mailing list.
> >
> > Today's Topics:
> >
> > 1. Re: Can't delete card (Alain Farmer)
> > 2. Re: Can't delete card (Mark Talluto)
> > 3. Re: Can't delete card (Ken Ray)
> >
> > --__--__--
> >
> > Message: 1
> > Date: Tue, 10 Dec 2002 18:38:05 -0800 (PST)
> > From: Alain Farmer <alain_farmer at yahoo.com>
> > Subject: Re: Can't delete card
> > To: metacard at lists.runrev.com
> > Reply-To: metacard at lists.runrev.com
> >
> > > When I try to delete a card via a bg script, I am
> > > given an Error message (...). the error message:
>
> > > Object: stack locked, or object's script is
> > > executing Chunk: can't delete object
> > > Is there a rationale behind this?
> >
> > Put the "delete" handler higher up in the hierarchy,
> > e.g. in the bg-script or in the stack-script. The
> > rationale is that you cannot delete the card that
> > contains the running handler. BTW it is still
> > "running" even though all of the statements have been
> > executed, because the last line has not executed yet,
> > e.g. the "end handlerName"
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
> >
> > --__--__--
> >
> > Message: 2
> > Date: Tue, 10 Dec 2002 19:14:53 -0800
> > Subject: Re: Can't delete card
> > From: Mark Talluto <lists at canelasoftware.com>
> > To: metacard at lists.runrev.com
> > Reply-To: metacard at lists.runrev.com
> >
> >
> > On Tuesday, December 10, 2002, at 06:38 PM, Alain Farmer wrote:
> >
> > >> When I try to delete a card via a bg script, I am
> > >> given an Error message (...). the error message:
>
> > >> Object: stack locked, or object's script is
> > >> executing Chunk: can't delete object
> > >> Is there a rationale behind this?
> > >
> > > Put the "delete" handler higher up in the hierarchy,
> > > e.g. in the bg-script or in the stack-script. The
> > > rationale is that you cannot delete the card that
> > > contains the running handler. BTW it is still
> > > "running" even though all of the statements have been
> > > executed, because the last line has not executed yet,
> > > e.g. the "end handlerName"
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > > http://mailplus.yahoo.com
> > > _______________________________________________
> > > metacard mailing list
> > > metacard at lists.runrev.com
> > > http://lists.runrev.com/mailman/listinfo/metacard
> > >
> > >
> >
> > All you have to do is use the send command to call another handler 1- 2
> > seconds later to do the delete card job for you. You may need to have
>
> > the handler being called by send put in the stack or some other
> > location that is not where the card to be deleted is.
> >
> >
> >
> > Best regards,
> > Mark Talluto
> > http://www.canelasoftware.com
> >
> >
> > --__--__--
> >
> > Message: 3
> > From: "Ken Ray" <kray at sonsothunder.com>
> > To: <metacard at lists.runrev.com>
> > Subject: Re: Can't delete card
> > Date: Tue, 10 Dec 2002 21:19:26 -0600
> > Organization: Sons of Thunder Software
> > Reply-To: metacard at lists.runrev.com
> >
> > > All you have to do is use the send command to call another handler 1-
2
> > > seconds later to do the delete card job for you. You may need to have
> > > the handler being called by send put in the stack or some other
> > > location that is not where the card to be deleted is.
> >
> > Actually you don't have to wait even that long; you can do a send in 100
ms
> > or less to have it work as well...
> >
> > Ken Ray
> > Sons of Thunder Software
> > Email: kray at sonsothunder.com
> > Web Site: http://www.sonsothunder.com/
> >
> >
> >
> > --__--__--
> >
> > _______________________________________________
>
> > metacard mailing list
> > metacard at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/metacard
> >
> >
> > End of metacard Digest
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
More information about the metacard
mailing list