Re: get handler name
Re: get handler name
- Subject: Re: get handler name
- From: Jed Verity <email@hidden>
- Date: Thu, 22 Mar 2001 15:17:32 -0800
I usually set a global variable to the handler name on each run to make the
handlerName accessible from any execution context. Not pretty but it works.
For example:
------begin script
global handlerName
on handlerOne()
set handlerName to "handlerOne"
...
end
on handlerTwo()
set handlerName to "handlerTwo"
...
end
------end script
HTH,
Jed
On 3/22/01 3:00 PM, you wanted me to know this:
>
On 3/22/01 2:02 PM, Brad Giesbrecht <email@hidden> wrote:
>
>
> Is there a way to get a handler's name?
>
>
>
> <snip>
>
> on handlerName()
>
> try
>
> on error
>
> set h to -- code that will return "on handlerName()"
>
> end try
>
> end handlerName
>
>
You can fake it:
>
>
on handlerName()
>
try
>
set foo to foo + 1 --create an error condition
>
on error
>
return "handlerName"
>
end try
>
end handlerName
>
>
--Michelle
>
>
----------------------------------------------------------------------
>
| Michelle Steiner | We're not human beings having a spiritual |
>
| | experience. We're spiritual beings |
>
| email@hidden | having a human experience. |
>
----------------------------------------------------------------------
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
~)~)~)~)~)~)~)~)~)~)~)~)~)
Jed Verity