Hello friends,

I know how to get the script from an objects script via script:
put the script of card "Foo" into tBar

But, I would like to get just one of the handlers from a script via script: put handler "FooBar" of the script of card "Foo" into tBar

Anyone know how to do this easily?

Thanks

Tom


Thomas J McGrath III
[EMAIL PROTECTED]


something like (not tested; watch line wraps)

put extractHandlerFromScript(the script of cd "Foo","FooBar") into tBar

function extractHandlerFromScript pScript,pHandlerName
  put lineOffset("on" && pHandlerName & space, pScript) into tHandlerBegin
if tHandlerBegin is 0 then put lineOffset("on" && pHandlerName & cr, pScript) into tFooBar1 if tHandlerBegin is 0 then put lineOffset("function" && pHandlerName & space, pScript) into tFooBar1 if tHandlerBegin is 0 then put lineOffset("function" && pHandlerName & cr, pScript) into tFooBar1
  if tHandlerBegin is 0 then return empty
  put lineOffset("end" && pHandlerName & cr, pScript) into tHandlerEnd
if tHandlerEnd is 0 then put lineOffset("end" && pHandlerName & space, pScript) into tHandlerEnd
  if tHandlerEnd is 0 then return empty
  return line tHandlerBegin to tHandlerEnd of pScript
end extractHandlerFromScript

If formatting is not so regular, you may need to account for multiple spaces between on/function/end and handler name.

Robert
_______________________________________________
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to