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 20:46:27 +0000
email@hidden wrote:
>>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)
>
>That is what I am being forced to do.
> >"macro-style script that inserts these automatically"
>I was not aware AS has Macro capabilities. how do you do it?
It doesn't (that's why I said 'macro-style'). However, most AS editors are scriptable so you could write a script that gets the current selection from the front window, crudely parses it (e.g. with a regex) to locate the start and end of a handler within that selection, extracts its name, then generates and inserts the relevant code automatically. Dump this script in the editor's script or contextual menu, and repeatedly inserting error reporting code becomes a trivial one-click operation. Little bit of work to write, but if you'll be doing this a lot then it's probably worth it.
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