filterString a maxFilePath
Hi there, I'm wondering how I'm able to get a part of the maxFilePath. I'm trying to separate the path but filterString doesn't allow me to use the "\".
I'm trying to get "Vorm Ontwikkeling bv" from the path underneath:
"Z:\Vorm Ontwikkeling bv\20627 - De Laverie te Oosterhout\03 Max\Scenes\Standpunten\VV 01\VV01_031.max"
function getFolderName = (
local sceneName = maxFilePath + maxFileName
local theName = filterString sceneName[4] "/"
local stringFolder = (theName[1])
return theName
)
Hoping for some help :)
Thank you.
Comments
.
Why you not remove the last 3 characters from the end result?
Tools and Scripts for Autodesk 3dsMax
*
instead of the filePath: "Z:\Vorm Ontwikkeling bv\20627 - De Laverie te Oosterhout\03 Max\Scenes\Standpunten\VV 01\VV01_031.max"
can I use: "maxFilePath + maxFileName" as well?
When I try that, I'm getting different results.
.
I have a Z drive and I tested with maxFilePath + maxFileName. The code that I posted works and the end result is the same for the provided path. Watch this:
https://drive.google.com/file/d/1DSTS86_ZKOOvovGOr4tQm3RZBLksvy1_/view?u...
Tools and Scripts for Autodesk 3dsMax
.
what if you do it like this?
filterString string "\\"
*
That seems to work I think, though I'm not getting the right result.
the sceneName = "Z:\Vorm Ontwikkeling bv\20627 - De Laverie te Oosterhout\03 Max\Scenes\Modellen\Omgeving\Omgeving_062.max"
function getFolderName = (
local sceneName = maxFilePath + maxFileName
local theName = (filterString sceneName "\\")
local stringFolder = (theName[2]) as string
return stringFolder
)
As a result I'm hoping to get is: "Vorm Ontwikkeling"
I probably need to add something to the stringFolder argument?