Forums > MaxMSP

Folder Listing?

November 17, 2006 | 3:15 pm

Hi All,

Kinda new to Max (just working with a demo copy to see if it’ll do what I need…so far so good :-)

I’m wondering .. what is a simple Max-based way to get a listing of folders within a specific folder…

e.g. I have a folder called Palettes which contains a set of sub-folders… I want to get a listing of those folders…

I’m trying to get the folder listing into a "coll" object . I can get my head around how to populate the coll object once I have the listing of files… but I want to be able to pass something a symbol which is the path to Palettes, and have it return the list of folders.

The folder object doesn’t seem to want to give me a listing of folders within a folder (maybe because the filetype needs to be specified – if so… what is the filetype of a folder?) BTW – The Palettes folder contains only these subfolders – no loose files..

Any ideas?…. thanks so much !

Valentin


November 17, 2006 | 3:51 pm

On Nov 17, 2006, at 10:15 AM, Valentin wrote:
> I’m wondering .. what is a simple Max-based way to get a listing of
> folders within a specific folder…

ubumenu
Toward the end of the palette. Read through all the subpatches in
the help file.

—–
Nathan Wolek
nw@nathanwolek.com

http://www.nathanwolek.com


November 17, 2006 | 4:33 pm

Thanks, Nathan :-)

I had tried ubumenu – and it doesn’t seem to quite do what I need (although looking at the subpatches made me aware of some other nice features there …

What I don’t understand is how do I then get the entire listing of folders to be sent out of the ubumenu at once – so that as soon as it determines the subfolders, that resulting listing can be used elsewhere?

e.g. I can get the Palettes folder to easily populate the ubumenu… I got that working.. the folder contains say, 10 subfolders. When ubumenu autopopulates, how do I get the resulting list immediately out of an output, so I can use it elsewhere… point is, in this context, i’m only using ubumenu to get the listing… not because I want an ubumenu for selection.

Does that make any sense?…

Thanks!

- Valentin


November 17, 2006 | 5:33 pm

Consulting the reference manual (and some patching) will help you. Try
to send ubumenu a count message:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 237 267 32 196617 print;
#P newex 237 236 47 196617 pack 0 s;
#P newex 343 161 27 196617 – 1;
#P newex 313 132 40 196617 uzi;
#P newex 313 106 61 196617 route count;
#P message 237 109 34 196617 count;
#P user ubumenu 237 200 100 196617 0 1 1 0;
#X prefix_set 0 1 /Users/ 0;
#P connect 5 0 6 0;
#P connect 0 1 5 1;
#P connect 0 0 5 0;
#P connect 1 0 0 0;
#P connect 2 0 3 0;
#P connect 4 0 0 0;
#P fasten 0 2 2 0 332 225 413 225 413 85 318 85;
#P connect 3 2 4 0;
#P window clipboard copycount 7;

Cheers,
/J

17/11/06, kl. 17:33 +0100 , skrev Valentin:

>
>Thanks, Nathan :-)
>
>I had tried ubumenu – and it doesn’t seem to quite do what I need
>(although looking at the subpatches made me aware of some other nice
>features there …
>
>What I don’t understand is how do I then get the entire listing of
>folders to be sent out of the ubumenu at once – so that as soon as it
>determines the subfolders, that resulting listing can be used elsewhere?
>
>e.g. I can get the Palettes folder to easily populate the ubumenu… I
>got that working.. the folder contains say, 10 subfolders. When ubumenu
>autopopulates, how do I get the resulting list immediately out of an
>output, so I can use it elsewhere… point is, in this context, i’m only
>using ubumenu to get the listing… not because I want an ubumenu for
>selection.
>
>Does that make any sense?…
>
>Thanks!
>
>- Valentin
>


November 17, 2006 | 5:46 pm

There was a third party "folder" object at some point. I used to use it to dump folder info into a umenu.


November 17, 2006 | 6:06 pm

That would be great to have…. if you can remember what it’s called, let me know :-)

Thanks!

- Val



jln
November 17, 2006 | 6:28 pm


November 17, 2006 | 6:39 pm

how about using the ‘types folder’ for the folder object, this will
give you subfolders of a folder ready for use in a menu. if you want
to use it differently just route the clear and append messages.

see below

htth

/*j

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 243 220 82 196617 print subfolders;
#P newex 202 191 93 196617 route clear append;
#P button 202 70 15 0;
#P newex 202 94 76 196617 opendialog fold;
#P newex 202 121 27 196617 t l b;
#P message 220 142 65 196617 types folder;
#P newex 202 165 37 196617 folder;
#P connect 5 1 6 0;
#P connect 0 0 5 0;
#P connect 4 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 0 0;
#P connect 2 1 1 0;
#P connect 1 0 0 0;
#P window clipboard copycount 7;


November 17, 2006 | 6:54 pm

Now we’re talking!!!! Thank you thank you!!

I had tried this as my first obvious thought (looking at the docs etc..) but the help file says it needs a 4 character filetype code when on Mac – so I was looking all over for some reference as to what the filetype code is for folders….

if i had known that you can just the type message with "folder" as its symbol… I literally would’ve saved an hour or more of trying to figure out how to do this…

Well…. now I know what to do… perfect! – next question… where does one look to get the real story on so many of these objects which seem to have either improperly, incompletely, or almost secretly documented features?

I’m big on the help files, the reference etc. and have been coding for years in other environments… but this kind of thing is really super-frustrating… I’ve never run across an environment where I can find what I need so quickly but the subtleties of how to use the objects… and their helpful features seem to be strewn all over…

I’m quickly getting the hang of programming withh Max and Jitter.. but it seems like the hard stuff is easy.. and the easy stuff… I spend most of my time looking for clues.. finding little tidbits at a time… weird

anyway…. thanks again for your help… ONE problem solved ;-)

- Valentin


November 17, 2006 | 6:56 pm

BTW – Seriously thank you all for taking the time to respond – THAT aspect of the Max/Jitter world is awesome – people who are quick to help other users… kicks butt !!

Thanks!

- Valentin


November 17, 2006 | 9:59 pm

Apart from the .help files & manual, a useful trick is Ctrl-alt-clicking on
an object, which gives a list of all the messages that it understands. Not
the whole story, I know, but well worth knowing,
Cheers
Roger

On 17/11/06 18:54, "Valentin" wrote:

> Well…. now I know what to do… perfect! – next question… where does one
> look to get the real story on so many of these objects which seem to have
> either improperly, incompletely, or almost secretly documented features?
>
> I’m big on the help files, the reference etc. and have been coding for years
> in other environments… but this kind of thing is really super-frustrating…
> I’ve never run across an environment where I can find what I need so quickly
> but the subtleties of how to use the objects… and their helpful features
> seem to be strewn all over…
>
> I’m quickly getting the hang of programming withh Max and Jitter.. but it
> seems like the hard stuff is easy.. and the easy stuff… I spend most of my
> time looking for clues.. finding little tidbits at a time… weird
>
> anyway…. thanks again for your help… ONE problem solved ;-)
>
> – Valentin


November 19, 2006 | 11:45 am

Valentin wrote:
> Well…. now I know what to do… perfect! – next question… where
> does one look to get the real story on so many of these objects which
> seem to have either improperly, incompletely, or almost secretly
> documented features?

just browse: for example in the folder help file, there is a reference
to opendialog, which is setup to open folders, which could let you
assume that the four letter secret code might be "fold"…

Just tested, "types fold" works as well…

> I’ve never run across an environment where I can find what I need so
> quickly but the subtleties of how to use the objects… and their
> helpful features seem to be strewn all over…

Yeah, we tend to underestimate our own knowledge if we compare different
environments, most things are documented, but if I don’t know where,
you feel lost. There is not much to do about it but build a reference
system which lets you browse. In that regard the Max help files are just
brilliant, especially if they are not perfect (which is expectable).

If you think, (after you painfully found the info,) something is missing
in an help file, just modify it, send it to support and ask to include
this mod into the next distribution…
I have done so with all the Max and MSP helpfiles, thats why they now
include the references to other helpfiles. That idea came originally up
with jitter btw…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


Viewing 12 posts - 1 through 12 (of 12 total)