Button to start an external script file

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
br0t's picture

thanks both of you, gonna try

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

Never get low & slow & out of ideas

Graph's picture

that include wont work as you

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 ;)

Raphael 'Insanto' Steves
http://Graph.Net84.Net

Anubis's picture

FileIn or Include

(
   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)
 
)

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.