Notifications
Clear all

[Closed] Variables = to file paths

Newb question. How can i set the following variable = to a directory path?

ToDir = (“Z:\image-dump\items”)

Everytime I try to first this, everything breaks

[size=2][color=white]What do I do?
[/color][/size]

2 Replies

Whenever you need to use a special character in a string, you need to precede it with an escape character, the backslash.

A file path would then look like this: “z:\foo\bar\blarg\”. The first backslash tells the intepreter to expect a special character and then you follow it with the special character. Quotes are done in the same way: “this is a “string” with quotes”.

A tab is , a newline is
, etc.

For file paths in MaxScript you can use the forward slash instead: “z:/foo/bar/blarg” but this isn’t something I like to do. If you are going to be passing the paths out to something external like a DOSCommand, then you want the backslashes in there.

Hope that helps.

That is exactly what I needed to know.

Thank you very much.

–J