How do I get the file name of the current scene?

MAXScript Frequently Asked Questions

A user asked:

I can't seem to find a function for grabbing the name of the currently open maxfile!

Answer:

The file name of the currently loaded scene can be accessed via the System Global Variable maxFileName. The path of the current scene is accessible through maxFilePath. Both variables are read-only!

To get the complete scene file name, you can use

For example

sceneName = maxFilePath + maxFileName

 

If the scene does not have a name yet (Untitled), both will return an empty string "".

These global variables are documented under the letter M in the topic 3dsmax System Globals

 

See also

3ds Max System Globals

3ds Max File Loading and Saving

Frequently Asked Questions