Maxscript back one folder

Maxscript back one folder

giuseppetonello
Advocate Advocate
1,170 Views
4 Replies
Message 1 of 5

Maxscript back one folder

giuseppetonello
Advocate
Advocate

How is it possible in Maxscript to go back one or two folders with the command

 

myDirectory = sysInfo.currentdir

 

So, if myDirectory returns c:\max\projects\whatever\maps

 

how do I point to c:\max\projects\?

Joey
0 Likes
Accepted solutions (1)
1,171 Views
4 Replies
Replies (4)
Message 2 of 5

pepetd
Enthusiast
Enthusiast

 

(
	myDirectory = sysInfo.currentdir
	filteredPath = filterString myDirectory"\\"
	finalPath = ""
	for i = 1 to (filteredPath.count - 1) do
	(
		finalPath = (finalPath + filteredPath[i] + "\\")
	)
	print finalPath
)

Here we go, not pretty but it works.

 

Message 3 of 5

giuseppetonello
Advocate
Advocate

What is this line doing, specifically?

 

	finalPath = ""

 

Joey
0 Likes
Message 4 of 5

Swordslayer
Advisor
Advisor
Accepted solution
0 Likes
Message 5 of 5

giuseppetonello
Advocate
Advocate

Man that's perfect. Thanks.

Joey
0 Likes