Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prevent Canceling



At 12:39 PM -0700 10/27/06, Stockly, Ed wrote:
So, is there anyway to prevent users from canceling a running script? (I used Hypercard or Prefab Plaer as workarounds in OS 9, but can't use them in OS 10.

Except if you using a faceless app, I think you cannot prevent the user from interrupting a script with an error number -128, and the error can happen just after (or sometimes, during) any instruction, so you have to handle explicitly the error everywhere, something certainly not simple.


try
-- do the normal thing
-- have all error traps explicitly forward number -128 errors
-- with lines like: on error s number n, if n = -128 then error s number n
on error number -128
-- handle "user canceled": restart everything from scratch, display insults, etc
end


Emmanuel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Prevent Canceling (From: "Stockly, Ed" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.