Notifications
Clear all

[Closed] How to get the path of the current opened MAXScript file?

Hi! I have a question.
How to get the path of the current opened MAXScript file?

For instance, if I opened a file of which the path is
D:\CG\Software Specific\max\MAXScript\MyScript\Plug-ins\Fix Normal\Fix Normal.ms,
how can I get its path?

4 Replies
1 Reply
(@merlinel)
Joined: 11 months ago

Posts: 0

Hi

When you manualy open or run a script via max interface… after you can use this:

sysInfo.currentdir + “\Fix Normal.ms”

 JHN

Or better yet lookup “MAXScript Source Filename Access”

getThisScriptFilename() 

-Johan

Thank you for your answer!

After I run

 
sysInfo.currentdir + "[\\Fix Normal.ms](file:///Fix%20Normal.ms)"

,I got the output:

 "C:\Program Files\Autodesk\3ds Max 9\Fix Normal.ms"

, so I think this is not my answer.

And after I run
[left]

 getThisScriptFilename() 

[/left]
[left]I got the output:[/left]
[left]

 [/left]
[left]"D:\CG\Software Specific\max\MAXScript\MyScript\Plug-ins\Vertex Color Tool\Vertex Color Tool.ms"[/left]
[left]

[/left]
[left], so I think this is my answer.[/left]

1 Reply
(@merlinel)
Joined: 11 months ago

Posts: 0

when you open or run a script manulay then sysInfo.currentdir will be changd to current file dir, after this you can get right file path.
but getThisScriptFilename() is better