Forums > MaxMSP

Topher LaFata's mxj filebrowse path problem

April 17, 2007 | 9:10 pm

Dear all, I have a little issue with mxj filebrowse on Mac Intel.

It seems to understand only native path (like "/Volumes/OSX/Users/bruno" or "/Applications" ) and not max path (like "OSX:/Users/bruno" ) that is what I obtain from opendialog fold, thispatcher and others objects.
And comformpath object with "pathstyle native" or something seems not change anything.

Does this patch work on your machine?
Thanks

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 119 33 78 196617 It doesn’t work;
#P message 17 50 33 196617 /tmp;
#P message 168 126 251 196617 OSX:/Users/;
#P hidden newex 168 99 62 196617 prepend set;
#P message 209 239 251 196617 OSX:/Users/;
#P hidden newex 209 217 62 196617 prepend set;
#P button 120 49 15 0;
#P user umenu 169 148 100 196647 1 64 164 1;
#X add max;
#X add native;
#X add colon;
#X add slash;
#X add native_win;
#P newex 170 173 91 196617 prepend pathstyle;
#P newex 120 195 66 196617 conformpath;
#P newex 120 75 71 196617 opendialog fold;
#P newex 120 217 80 196617 prepend root;
#P hidden newex 42 221 48 196617 loadbang;
#P button 42 243 15 0;
#P message 26 67 71 196617 /Applications;
#P user lcd 120 287 200 200 0 1 0 0 1;
#P newex 120 265 185 196617 mxj filebrowse /Applications 200 400;
#P comment 22 33 48 196617 It works;
#P connect 8 0 6 0;
#P hidden fasten 8 0 12 0 125 214 214 214;
#P connect 7 0 8 0;
#P hidden fasten 7 0 14 0 125 95 173 95;
#P fasten 16 0 6 0 22 214 125 214;
#P fasten 3 0 6 0 31 214 125 214;
#P connect 6 0 1 0;
#P hidden connect 14 0 15 0;
#P hidden connect 12 0 13 0;
#P connect 11 0 7 0;
#P fasten 9 0 8 0 175 192 125 192;
#P fasten 10 1 9 0 264 168 175 168;
#P fasten 4 0 1 0 47 262 125 262;
#P hidden fasten 5 0 4 0 47 240 47 240;
#P fasten 1 0 2 0 125 291 125 291;
#P window clipboard copycount 18;


April 17, 2007 | 9:14 pm

ps: the error that is gives me is:
• error: (mxj filebrowse) Invalid root directory argument


April 18, 2007 | 12:44 am

Hello Bruno.
Your patch doesn’t work on my pc.
But it does if the argument corresponds to any of my existing folders (and
without the conformpath object).
Also the pathstyle has no influence.

Hope that helps.
Cheers.


April 18, 2007 | 8:21 pm

Quote: gusanomaxlist wrote on Wed, 18 April 2007 02:44
—————————————————-
> Hello Bruno.
> Your patch doesn’t work on my pc.
> But it does if the argument corresponds to any of my existing folders (and
> without the conformpath object).
> Also the pathstyle has no influence.
>
> Hope that helps.
> Cheers.
>
>
>
—————————————————-

Thank you. With "if the argument corresponds to any of my existing folders", do you mean that you send to mxj filebrowse a native path or a max path?
Because I know that a native path (like /Applications ) works, the problem is that there is no objects that give me this kind of path.


April 19, 2007 | 1:11 pm

>
> Thank you. With "if the argument corresponds to any of my existing
> folders", do you mean that you send to mxj filebrowse a native path or a max
> path?

I mean that [mxj filebrowse] must be loadbanged with an existing folder
argument (native or max path work both), if I initialise filebrowse with any
other folder (that doesn’t exist on my computer), it doesn’t work at all,
whatever path I send to him.

Because I know that a native path (like /Applications ) works, the problem
> is that there is no objects that give me this kind of path.

If you want your path to be stripped and only keep the last folder name
(like /Applications), it can be done with zl and atoi tricks (I should have
a patch like that somewhere).
But am I missing something or is the following patch working for you ?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 140 34 78 9109513 and that?;
#P message 17 38 33 9109513 /tmp;
#P message 168 114 251 9109513 OSX:/Users/;
#P hidden newex 168 87 62 9109513 prepend set;
#P button 120 37 15 0;
#P newex 120 63 71 9109513 opendialog fold;
#P newex 120 205 80 9109513 prepend root;
#P hidden newex 42 209 48 9109513 loadbang;
#P button 42 231 15 0;
#P message 26 55 71 9109513 /Applications;
#P user lcd 120 279 200 200 0 1 0 0 1;
#P newex 120 253 185 9109513 mxj filebrowse /Applications 200 400;
#P comment 22 21 48 9109513 It works;
#P connect 1 0 2 0;
#P connect 7 0 6 0;
#P hidden fasten 7 0 9 0 125 83 173 83;
#P hidden fasten 5 0 4 0 47 228 47 228;
#P fasten 4 0 1 0 47 250 125 250;
#P connect 8 0 7 0;
#P hidden connect 9 0 10 0;
#P connect 6 0 1 0;
#P fasten 3 0 6 0 31 202 125 202;
#P fasten 11 0 6 0 22 202 125 202;
#P window clipboard copycount 13;

Cheers.


April 19, 2007 | 4:34 pm

Quote: gusanomaxlist wrote on Thu, 19 April 2007 15:11
—————————————————-
> If you want your path to be stripped and only keep the last folder name
> (like /Applications), it can be done with zl and atoi tricks (I should have
> a patch like that somewhere).

No, I would like that it works with folders of any level.

I would like that something like "MYPARTITION:/folder1/folder2" becames "/Volumes/MYPARTITION/folder1/folder2", that works with "mxj filebrowse".

> But am I missing something or is the following patch working for you ?
—————————————————-

No, it doesn’t.
With the "opendialog folder" path style, it gives me the following error:
"• error: (mxj filebrowse) Invalid root directory argument"

Is this a bug report of the mxj’s path on Mac-Intel?


April 19, 2007 | 6:22 pm

>
> With the "opendialog folder" path style, it gives me the following error:
> "• error: (mxj filebrowse) Invalid root directory argument"
>
> Is this a bug report of the mxj’s path on Mac-Intel?

Well, I guess it looks like a bug. I have the same error as you, but a
possible workaround for me is, as stated previously, to put any existing
folder name as an argument of filebrowse
(for example [mxj filebrowse ./patches 200 400] ), double click loadbang
and then it works with any opendialog folder path.


April 19, 2007 | 7:23 pm

Yes I know, but I would like to change dinamically the path, and it seems to be not possible… isn’t it?


April 19, 2007 | 9:03 pm

Once I have correctly initialised filebrowse, I can dynamically change the
path, yes.
Unfortunately, I don’t have a Mac Intel so I can’t test that with Mac style
path…

On 4/19/07, Bruno Zamborlin wrote:
>
>
> Yes I know, but I would like to change dinamically the path, and it seems
> to be not possible… isn’t it?
>


April 22, 2007 | 5:31 pm

i use the following subpatch to fix path issues with volumes that are not the root volume on osx.
i think the left output conforms the path for java and the right output escapes white space in the folder names.
the left out should be find for working with java.

make sure you save and reload for the loadbangs to bang.
not sure if this helps you but…

#P outlet 79 225 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 240 300 29 196617 gate;
#P newex 278 325 48 196617 pv store;
#P newex 259 278 55 196617 delay 200;
#P newex 168 254 31 196617 t s 0;
#P newex 240 253 48 196617 t 1 b s;
#P newex 240 232 51 196617 tosymbol;
#P message 208 170 98 196617 substitute "%1\\ ";
#P newex 168 232 51 196617 tosymbol;
#P newex 168 210 108 196617 regexp @re (\\S)\\s;
#P outlet 168 359 15 0;
#P inlet 35 33 15 0;
#P message 88 132 143 196617 substitute /Volumes/%1/%2;
#P newex 79 179 51 196617 tosymbol;
#P newex 79 155 90 196617 regexp (.*):/(.*);
#P newex 138 30 50 196617 loadbang;
#P message 214 54 79 196617 pathstyle slash;
#P message 138 54 73 196617 pathtype boot;
#P newex 35 87 98 196617 conformpath;
#P fasten 17 0 16 0 245 321 283 321;
#P connect 13 2 16 0;
#P connect 15 0 17 1;
#P connect 13 1 15 0;
#P connect 13 0 17 0;
#P fasten 14 1 17 0 194 285 245 285;
#P connect 12 0 13 0;
#P connect 9 3 12 0;
#P fasten 3 0 6 0 143 50 93 50;
#P connect 3 0 1 0;
#P fasten 3 0 11 0 143 50 213 50;
#P fasten 3 0 2 0 143 50 219 50;
#P connect 14 0 8 0;
#P fasten 16 0 8 0 283 350 173 350;
#P connect 10 0 14 0;
#P connect 9 0 10 0;
#P fasten 11 0 9 0 213 199 173 199;
#P connect 5 0 18 0;
#P fasten 5 0 9 0 84 203 173 203;
#P connect 4 0 5 0;
#P fasten 4 3 5 0 144 175 84 175;
#P fasten 0 0 4 0 40 150 84 150;
#P fasten 6 0 4 0 93 151 84 151;
#P connect 7 0 0 0;
#P fasten 2 0 0 0 219 77 40 77;
#P fasten 1 0 0 0 143 77 40 77;
#P window clipboard copycount 19;


April 22, 2007 | 5:46 pm

Thank you very much rob, your path fixed perfectly the problem!

Quote: robtherich wrote on Sun, 22 April 2007 19:31
—————————————————-
> i use the following subpatch to fix path issues with volumes that are not the root volume on osx.
> i think the left output conforms the path for java and the right output escapes white space in the folder names.
> the left out should be find for working with java.
>
—————————————————-


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