ScriptSpot

Forum topic · General Scripting

Button to start an external script file

By br0t · 2010-11-25

Description

Heyho,
I do have an attribute holder on a control object, which has a custom attribute definition with a button in it. I would like to use the button to start up an external script file, but I cannot find out how. I need something like this:


on btn_script pressed do
(    
"if external script can be found, execute it now"
) 

Guess its not such big of a deal, but err...help needed^^
Regards

Comments (3)

br0t · 2010-11-26

thanks both of you, gonna try it out soon ;)

Graph · 2010-11-26

that include wont work as you gotta define the path directly after the call not a ref var
at least in the past it was like that ;)

FileIn or Include

Anubis · 2010-11-26

(
   local scrFile = "script.ms"

-- using FileIn():
   on btn_script pressed do
      (if doesFileExist scrFile do FileIn scrFile)

-- using Include():
   on btn_script pressed do
   (if doesFileExist scrFile do include scrFile)

)