Forums > MaxMSP

searchpath scripting

April 9, 2009 | 5:57 pm

I just discovered the "setsearchpath" message to Max as had some questions about related possibilities.

The implementation I have seen sets the searchpath to a specific number in the list. I’m guessing there is no way to just automatically add it to the end of the list? As a way to achieve that, is there a way to find out how many items are currently in the searchpath preferences?

Anyone know if there is a way to send a message to Max to remove something for the searchpath?

I see there is a "paths" message, but that just prints to the Max window. I was hoping there may be some other options since "setsearchpath" doesn’t seem to be listed in the documentation (at least I don’t see it).



MIB
April 9, 2009 | 7:04 pm

do you know about filepath? I think it does everything you asked…


April 9, 2009 | 7:10 pm

Now that you mention it, I think I had seen the [filepath] object before, but didn’t consciously know about it. As you say, looks like it does everything I want.

Thanks!


April 10, 2009 | 3:57 am
Roth wrote on Thu, 09 April 2009 14:10
Now that you mention it, I think I had seen the [filepath] object before, but didn’t consciously know about it.

Possibly the "path" message to [thispatcher] could also be helpful if you want to know where your patch is, like when moving to different machines.


April 10, 2009 | 4:37 am

One more question about [filepath]:

Is there a way to tell it to search in subfolders?


April 10, 2009 | 4:53 am

In addition to the subfolder question, I’ve got one more:

Does what I describe in this example below correctly portray the difference between using "append HD:/my/path"->[filepath search] and "set HD:/my/path"->[filepath search 0]? Are there any other differences besides what I mentioned?

– Pasted Max Patch, click to expand. –

April 10, 2009 | 7:18 pm
Quote:
I’m guessing there is no way to just automatically add it to the end of the list? As a way to achieve that, is there a way to find out how many items are currently in the searchpath preferences?

no straight forward or automatic way, but of course this could all be programmed in max.
to find out you would have to read all possible entries and create a frontend for it. but i see no reason why it could be useful to set search path 1 and 3 but not 2.

Quote:
Anyone know if there is a way to send a message to Max to remove something for the searchpath?

unlock the file preferences window, copy its content, and you will learn it in a few minutes.

-110

p.s.:
it is not recommended to have search paths outside the maxmsp folder. these stop working when moving to another computer, building a standalone, or even after repairing the harddrives catalog structure. if someone thinks that is a dumb comment or has other experiences, please let us know.


April 10, 2009 | 8:19 pm
Roman Thilenius wrote on Fri, 10 April 2009 15:18
but i see no reason why it could be useful to set search path 1 and 3 but not 2.

No, but if I was adding a searchpath to a specific slot on another persons computer I would want to make sure I put it at the end of the list to make sure I didn’t overwrite any of their searchpaths

Roman Thilenius wrote on Fri, 10 April 2009 15:18
unlock the file preferences window, copy its content, and you will learn it in a few minutes.

Is this a patch in Max5? I couldn’t seem to find where it is saved. I didn’t bother looking at the Max4.6 patch because I heard some things changed how file preferences work between 4 and 5.

[quote title=Roman Thilenius wrote on Fri, 10 April 2009 15:18
p.s.:
it is not recommended to have search paths outside the maxmsp folder. these stop working when moving to another computer, building a standalone, or even after repairing the harddrives catalog structure. if someone thinks that is a dumb comment or has other experiences, please let us know.[/quote]

I don’t see how this is a problem at all (and isn’t that kind of the point of the search path window? because otherwise couldn’t you just stick it all in the ./patches folder?–what I used to do when I started Maxing). I have a folder on my users partition for 3rd party externals and a folder for my own externals/abstractions. For how often I make changes to those folders, I wouldn’t want to be writing to my applications folder (and therefor my startup volume) that often.

Yes this does present a problem when I move to another computer, but there is no guarantee that the 3rd party objects I use (and surely not my own) would be on that computer. In the past, I always would just add the needed folders to the "File Preferences" window; that is why I was looking for a way to temporarily add something to the Max just for that work session. Beyond the reasons why I don’t keep my own objects in the Max folder, three is a whole list of reasons why I wouldn’t want to be doing that on other’s computers.

For standalones, I would just add the necessary folders/files to the support folder. At least for me there is no need to structure my normal patching and harddrive use procedure around saving standalones.

Have you really had problems with that making directory repairs? To my knowledge I’ve never encountered anything like that and am a little skeptical that it would make a difference.


April 11, 2009 | 2:00 am
Quote:
No, but if I was adding a searchpath to a specific slot on another persons computer I would want to make sure I put it at the end of the list to make sure I didn’t overwrite any of their searchpaths

hm, that makes sense. what about using slot 913-917?

Quote:
and isn’t that kind of the point of the search path window? because otherwise couldn’t you just stick it all in the ./patches folder?

thats also right. then again, if it would not be for the extras, i would have removed the patches folder from my search path and have custom folders only instead.

and to avoid writing patches and audiofiles in the startup partition, you could have the max app side by side with the project files on your max volume … Smile
(i have a maxmsp volume, an audiofile volume, a video file volume, a backup volume, and many others … the application folder must be that thing in OSX which i dont use .. isnt that where rubbish like itunes and internet config helper is stored?trash those if you love your mac!)

Quote:
For standalones, I would just add the necessary folders/files to the support folder. At least for me there is no need to structure my normal patching and harddrive use procedure around saving standalones.

ah yeah, the support folder, thats also right.

Quote:
Have you really had problems with that making directory repairs?

actually i dont remember it beeing maxmsp (i would also assume that its just looking for the names of the files and folders) but i had problems of that type more than one time.


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