How to list the subfolders of a folder

Oct 23, 2011 at 8:27am

How to list the subfolders of a folder

Hi,

Is it possible to list the subfolders of a folder in Max or javascript for Max? I know about the [folder] object but I can’t see how it can be used to list the subfolders of a folder (no appropriate ‘types’ message). I’m working with Max 5 on OS X SL.

Cheers,

Aengus.

#59502
Oct 23, 2011 at 8:41am

hi,

have a look to :
/Applications/max5/examples/javacript/file/jsfolderiter.js

#214128
Oct 23, 2011 at 8:43am

Oops. Sorry- it’s right there in the js docs:


inlets = 1;
outlets =1;

function listfolder(x)
{
f = new Folder(x);
while(!f.end)
{
post(f.filename);
if (f.filetype == "fold")
{
outlet(0,f.filename);
}
f.next();
}
}

Cheers,

Aengus.

#214129

You must be logged in to reply to this topic.