MAXScript Source Filename Access

new.gif NEW in 3ds Max 9: These methods allows a script to query the source file it has been run from and the position inside the source file:


Returns the filename path of the source file the function has been called from.

Returns undefined if the call does not occur from a valid MAXScript file, for example if executed in the Listener or from an Untitled (not yet saved) file.

If the method has been called from inside a string evaluated using the execute() method, the result will still be the file the execute() has been called from.


Returns the character position in the source script file, 'undefined' if not called from a source script file. The resturn value is IntegerPtr to ensure that the position would be valid even with files over 4GB.