Re: Run Handler-Name from Text?
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