• 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: Run Handler-Name from Text?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run Handler-Name from Text?


  • Subject: Re: Run Handler-Name from Text?
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 20 Apr 2012 15:13:51 +1000

On 19/04/2012, at 5:55 PM, Christopher Stone wrote:

More grist for the mill.

And yet more:

on handler_f()
return "f!"
end handler_f

on handler_g()
return "g!"
end handler_g

on handler_h()
return "h!"
end handler_h

set lookup to {{handler_f:handler_f}, {handler_g:handler_g}, {handler_h:handler_h}}

set theHandler to handler_for("handler_f")
theHandler()

on handler_for(x)
tell application "ASObjC Runner" 
set y to value for key path x of item my lookup
return item 1 of (modify list y with removing blanks)
end tell
end handler_for

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Run Handler-Name from Text? (From: Christopher Stone <email@hidden>)
 >Re: Run Handler-Name from Text? (From: Tom Robinson <email@hidden>)
 >Re: Run Handler-Name from Text? (From: Christopher Stone <email@hidden>)
 >Re: Run Handler-Name from Text? (From: Stan Cleveland <email@hidden>)
 >Re: Run Handler-Name from Text? (From: Christopher Nebel <email@hidden>)
 >Re: Run Handler-Name from Text? (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Solution for Mac Lion window parameters
  • Next by Date: Re: Solution for Mac Lion window parameters
  • Previous by thread: Re: Run Handler-Name from Text?
  • Next by thread: Re: Run Handler-Name from Text?
  • Index(es):
    • Date
    • Thread