reducing save path
hi guys,
i'm trying to create new save path for maxfile. when i get maxfilepath i would like to reduce last, maybe last two folders in path
e.g.
"D:\Test_Area\TestProject\Scenes\subfolderA\"
to
"D:\Test_Area\TestProject\Scenes\"
the idea is to take path and reduce it, and then attach new folder name at the end and create the new path.
"D:\Test_Area\TestProject\Scenes\subfolderB"
I tried to filterstring array and delete last part but dont know how again assemble content of the array into something that can be used as string for save path
can you plz help me?
Thanx,
Jan
Comments
Thanx guys, you've been most
Thanx guys, you've been most helpful. Thanx again!!!
oldFilePath= "D:\Test_Area\T
oldFilePath= "D:\Test_Area\TestProject\Scenes\subfolderA"
newPath = (pathConfig.removePathLeaf oldFilePath) + "\subfolderB"
Cool, I didn't know about
Cool, I didn't know about the pathconfig struct... thanks!
( fn reduceFolder thePath
The function in there should do what you want. Just feed it the path and the number of folders you want to cut.
Look for getSaveFileName()
Look for getSaveFileName() function in MXS Reference - "Standard Open and Save File Dialogs" topic.
my recent MAXScripts RSS (archive here)