Re: get handler name
Re: get handler name
- Subject: Re: get handler name
- From: Jason Bourque <email@hidden>
- Date: Thu, 22 Mar 2001 20:03:41 -0500
>
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
>
>
>
Thanks,
>
BG
Brad,
I just wrote this handler that lists the handlers in a script. Let me know
how it works out.
on handleName()
end handleName
on handleName2()
end handleName2
on handleName3()
end handleName3
on handlerLister()
set myScriptText to me as text
set tids to text item delimiters
set text item delimiters to {"on" & " "}
set myScriptTextItems to text items of myScriptText
set text item delimiters to tids
set handlerList to {}
repeat with nth from 1 to count of myScriptTextItems
set listItem to item nth of myScriptTextItems
if listItem is not "" then
set end of handlerList to text 1 thru ((offset of "(" in
listItem) - 1) of listItem
end if
end repeat
handlerList
end handlerLister
handlerLister()
Thanks,
Jason Bourque