Re: Handling a system shutdown

2002-12-12 Thread Ken Ray
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: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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
  [EMAIL PROTECTED]
 
  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
  [EMAIL PROTECTED]
 
  You can reach the person managing the list at
  [EMAIL PROTECTED]
 
  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 [EMAIL PROTECTED]
  Subject: Re: Can't delete card
  To: [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
 
   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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
 
 
  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
   [EMAIL PROTECTED]
   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 [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: Re: Can't delete card
  Date: Tue, 10 Dec 2002 21:19:26 -0600
  Organization: Sons of Thunder Software
  Reply-To: [EMAIL PROTECTED]
 
   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: [EMAIL PROTECTED]
  Web Site: http://www.sonsothunder.com/
 
 
 
  --__--__--
 
  ___

  metacard mailing list
  [EMAIL PROTECTED]
  http://lists.runrev.com/mailman/listinfo/metacard
 
 
  End of metacard Digest

 

Re: Handling a system shutdown

2002-12-12 Thread David Epstein
on 12/12/02 Ken Ray answered my question about how to intercept a system
shutdown:

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

This does the job.  Thank you!  Can something like this be done in Windows?

David Epstein

PS:  Apologies to all for having accidentally replicated the digest in my
original query.

___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard