Forums > MaxMSP

ubumenu question

January 12, 2006 | 8:55 pm

Hi all,

Sorry if you got this earlier.

Using regexp, based on something Patrick Delges posted last year, I’m
finding the contents of a folder named "films" that resides in the
same directory as a standalone. The folder contents populate an
ubumenu as expected. What’s not happening (that is expected) is for
the ubumenus dumpout to report the number of items in the folder
through the "populate" message.

I imagine it’s something obvious I’m missing, but I havent been able
to figure it out. Or am I misunderstanding the messgae?

I have an example of the application, patches and example files here :

http://droolcup.com/ubuissue.zip.

TIA,

~scott


January 15, 2006 | 10:50 am

This is a misunderstanding of how ubumenu’s autopopulate feature
works. If you use ubumenu to do your folder scanning, file gathering
and so on, using the "prefix" message or the prefix field in the
inspector, then autopopulate is relevant, and any files found in the
"prefix" folder will be reported from the dumpout, preceded by the
word "prefix". The way you’re using it, you just want to send the
message "count" to ubumenu, once you’re finished with your appending
stuff, or do what John suggested.

However, I have never understood why people use the folder object AND
the ubumenu object for managing folder contents. This is a good
example of old habits dying hard. Here’s your patch again, with
"findmeshitsc" turned into a subpatch, and the folder object
dismissed. Note that you had changed the prefix setting to "prefix"
rather than "concatenate" — for path stuff, concatenation is what
you want.

Cleaner and works as desired, when built into a standalone.

jb

#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 205 158 173 196617 the "auto-populate" flag is set in
ubumenu. also CONCATENATE has to be turned on for path stuff to work.;
#P window linecount 1;
#P newex 64 251 63 196617 jit.qt.movie;
#P newex 64 213 68 196617 prepend read;
#P number 187 231 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 187 199 74 196617 route populate;
#P user ubumenu 97 168 100 196617 0 1 1 0;
#X prefix_set 0 1 0;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 247 275 76 196617 prepend prefix;
#P window linecount 1;
#P message 383 137 62 196617 types MooV;
#P newex 70 49 29 196617 t b b;
#P newex 247 252 50 196617 tosymbol;
#P newex 247 224 80 196617 sprintf %sfilms;
#P newex 70 136 50 196617 tosymbol;
#P newex 70 167 159 196617 regexp (.+\\/).+\\/.+\\/.+\\/;
#P newex 70 112 51 196617 r thePath;
#P window linecount 2;
#P message 70 75 169 196617 ; max runtime 1 sendapppath thePath;
#P window linecount 1;
#P newex 70 29 45 196617 loadbang;
#P comment 231 168 100 196617 removes end of path;
#P outlet 247 304 15 0;
#P connect 2 0 9 0;
#P connect 9 0 3 0;
#P connect 4 0 6 0;
#P connect 6 0 5 0;
#P fasten 5 1 7 0 149 191 252 191;
#P connect 7 0 8 0;
#P connect 8 0 11 0;
#P connect 11 0 0 0;
#P fasten 10 0 0 0 388 297 252 297;
#P fasten 9 1 10 0 94 69 388 69;
#P pop;
#P newobj 97 130 75 196617 p findmeshitsc;
#P window linecount 7;
#P comment 184 53 100 196617 this loads the path and the files into
the ubumenu.. it looks for a folder called "films" that resides in
the same directory;
#P window linecount 5;
#P comment 256 237 100 196617 i expect this to show the number of
quicktime movie files in the folder "films";
#P connect 3 1 6 0;
#P connect 6 0 7 0;
#P connect 2 0 3 0;
#P connect 3 2 4 0;
#P connect 4 0 5 0;
#P window clipboard copycount 9;


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