• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get handler name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >get handler name (From: Brad Giesbrecht <email@hidden>)

  • Prev by Date: Re: Unloading Coercions
  • Next by Date: Re: get handler name
  • Previous by thread: get handler name
  • Next by thread: Re: get handler name
  • Index(es):
    • Date
    • Thread