Re: how to get the name of the current handler
Re: how to get the name of the current handler
- Subject: Re: how to get the name of the current handler
- From: has <email@hidden>
- Date: Mon, 7 Nov 2005 19:09:28 +0000
email@hidden wrote:
>I am trying to avoid hard coding, so that it can be a generic error trap function. It seems like Applescript does not have this. Maybe in 2.0 handler properties can be added, such as it's name and even the handle itself.
What you're talking about is introspection, which AppleScript doesn't have. (It wouldn't be a terribly appropriate feature for the type of audience AS is primarily targeted at anyway.) What you really want is automatic tracebacks, but AS doesn't provide those either. (This is a genuinely annoying omission, but that's AS for you.)
For debugging scripts during development, you might consider investing in a copy of Script Debugger <http://www.latenightsw.com/>; I'm sure other folks here can brief you on the capabilities of its AS debugger component.
For producing end-user error messages, you'll need to provide your own reporting code (e.g. wrapping the body of each handler in a try block that extends the error message string with its own information, then rethrows the error). You could always write a macro-style script that inserts these automatically.
HTH
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden