Notifications
Clear all
[Closed] find filename in a folder
Apr 20, 2009 4:51 pm
Hey Guys,
my script finds max files in a set directory named like the current selection:
files = getFiles (trydir+$.name+"*.max")
gives this output: #(“Z:\BWS\max\G11.max”)
i want to get just the filename, i.e. “G11.max”
Any ideas how I can do this?
5 Replies
Apr 20, 2009 4:51 pm
Hi leigh, check out the topic File Name parsing in the maxscript help. you will find a function called getfilenamefile <file string> that you can use to do this.
if you also check the external file methods topic you will find a recursive search function for finding files in nested folders, which might help you with your other post.
Apr 20, 2009 4:51 pm
Have you tried this:
files = (getFiles (trydir+$.name+"*.max"))[1]
Cheers.
Apr 20, 2009 4:51 pm
that gives “Z:\BWS\max\G11.max”, thanks anyway.
will try lonerobot’s suggestion now
Apr 20, 2009 4:51 pm
I stand corrected…
files = filenameFromPath (getFiles (trydir+$.name+"*.max"))[1]