Passing a variable into a path name

I'm still quite new to scripting in general so this could be totally wrong what I'm trying to do?

In the addNewXRefFile i am trying to replace the maxFile name with a variable holding that name. Not sure why it doesn't work or even if it's possible?

newMod= "test.max"
xrefs.addNewXRefFile "C:/Desktop/newMod"

Any help would be much appreciated.

Thanks

Comments

Comment viewing options

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

if you write something

if you write something between "" its a string. So maxscript doesnt know "newMod" like this is a variable.
you can test this in the listener.
if you want to a variable to a string write this:

newMod = "test.max"
newXRefFile = "C:/Desktop/" + newMod
xrefs.addNewXRefFile newXRefFile

write each line in the listener and check what you're trying to do

ce89's picture

thanks jos, these answers

thanks jos,

these answers always seem simple afterwards. :)

Comment viewing options

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