Filename String with include ""

This might be a relatively easy question, but I am stumped. I am trying to reference a .ms of functions into another script, which runs the functions.

I am using the include "filename_string" and I am having some difficulty.

I can get this to work:

include "C:\Users\(hardcodeusernamehere)\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts\Custom\Submission_Lib.ms"

but not this:

include (("C:\\Users\\" + sysInfo.username + "\\AppData\\Local\\Autodesk\\3dsMax\\2012 - 64bit\\enu\\scripts") + "\\Custom\\" + "Submission_Lib.ms")

i can get this to work (prints right value):

thepath = (("C:\\Users\\" + sysInfo.username + "\\AppData\\Local\\Autodesk\\3dsMax\\2012 - 64bit\\enu\\scripts\\Custom\\Submission_Lib.ms") as string)
print (thepath as string)

but not this:

thepath = (("C:\\Users\\" + sysInfo.username + "\\AppData\\Local\\Autodesk\\3dsMax\\2012 - 64bit\\enu\\scripts\\Custom\\Submission_Lib.ms") as string)
include (thepath as string)

Any Ideas? Thanks!

Comments

Comment viewing options

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

Use sysinfo.currentdir

sysinfo.currentdir = getDir #userScripts + @"\TrackScripts\")
include "myScript.ms"
jos's picture

path = getDir #userscripts +

path = getDir #userscripts + "\Submission_Lib.ms"
include path

this works fine for me..

 
getDir #userscripts
"C:\Users\Jos\AppData\Local\Autodesk\3dsMax\2012 - 64bit\enu\scripts"

Comment viewing options

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