Home Technical Talk

Maxscript open subfolders

liamcramb
null
Offline / Send Message
Pinned
liamcramb null
I'm attempting to write a maxscript that opens max files in a folder that has subfolders, perform some tasks, save the file and open the next file in the folder. I've got the script working perfectly for all of the max files in the root folder, but I can't seem to get it to open the sub folders. If anyone could help figure out what the problem is it would really be appreciated, thanks :) After looking at the autodesk help page on opening files, I have this: 

thePath = getSavePath(r)--get a path dialog to specify the path
if thePath != undefined do--if the user did not cancel

(
setVRaySilentMode()
Fn getMaxFiles_fn dir =
(
local dir1 = getDirectories (dir + "*")
for d in dir1 do
(
join dir1 (getDirectories (d + "*"))
)
local files = #()
for f in dir1 do
(
join files (getFiles (f + "/*.max"))
)
)

for f in thefiles do
Sign In or Register to comment.