Search code examples
maxscript

call maxscript from another maxscript


I'm trying to write a function that calls an external script but am not having any luck with the syntax

scripts_folder = "C:\\Program Files\\Autodesk\\3ds Max 2008\\Scripts"
var script1 = "hello_world.ms"

-- use function to call scripts
callScript(script1)

-- function callScript
function callScript script =
(
getFiles scripts_folder + "\\" + script
)

Solution

  • Figured it out!

    --- "hello_world.ms"
    enter function hello =
    (
    print "hello the world"
    )
    
    
    ---- another _script.ms
    fileIn "hello_world.ms"
    
    -- use function to call scripts
    

    hello ()

    It seems that fileIn works better than include