• 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: Stan Cleveland <email@hidden>
  • Date: Tue, 17 Apr 2012 12:35:47 -0700


On Apr 16, 2012, at 7:53 PM, Christopher Stone wrote:

I've tried a number of variations of 'run script'.
<snip>
Please demonstrate how to successfully make 'run script' use handlerToRun as a parameter.

Hi Chris,

The best solution I see is to include the handlers in the text, along with the handler call. Something like this:

set handlersABC to "
on myHandlerNameA()
display dialog \"Eureka!  It works.\"
end myHandlerNameA

on myHandlerNameB()
display dialog \"Oh, boy!  It works.\"
end myHandlerNameB

on myHandlerNameC()
display dialog \"Hooray!  It works.\"
end myHandlerNameC
"
set lookUpTable to "
myCriterionA          myHandlerNameA()
myCriterionB          myHandlerNameB()
myCriterionC          myHandlerNameC()
"
set handlerToRun to do shell script "sed -nE 's/^myCriterionB +(.+)/\\1/p' <<< " & quoted form of lookUpTable
run script (handlerToRun & return & handlersABC)

Stan C.

 _______________________________________________
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

  • Follow-Ups:
    • Re: Run Handler-Name from Text?
      • From: Christopher Nebel <email@hidden>
    • Temperature sensors
      • From: Javi PĂ©rez <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>)

  • Prev by Date: Re: deciphering TextCommand match info record
  • Next by Date: Temperature sensors
  • Previous by thread: Re: Run Handler-Name from Text?
  • Next by thread: Temperature sensors
  • Index(es):
    • Date
    • Thread