How to modify the path opened with a read message from a patch

rodolphe.koehly's icon

Hi anyone,

I am looking for a way to control the path that is opened when sending a read or write message to a coll object. The objective is to have a dedicated folder inside my main patch folder for storing presets, and that the read and write message directly lead to that folder. By default, it seems that this path is set to the one of the last patcher opened, and I did not find how to modify this.
Sending a read message along with a path name does not work.
I did not find any message to send neither to the coll object, nor to max to set a new path.
I am using max5.

Thanks in advance,

rodolphe.koehly's icon

I finally found a way.
As the path is set in function the last file stored or opened, I just send before a write message with the name and path of a file that is already inside the folder I want to set. You can also send a read message of an already existing file inside the folder that is in interest instead.
Then, as long as you do not change the path by the same way, it should be set to the folder you want.

Maybe this will help sb else,

Michel's icon

I use Javascript like Patrick Delges said.

Save this as "js NameFile.js :
function name ()
{
outlet (0,this.patcher.name);
}

Max Patch
Copy patch and select New From Clipboard in Max.

And, there is my patch

This way, I know the path of the patch I open. All files like Coll, Pattrstorage etc... are saved in a subfolder named "Pref".

It's not very simple, but it works, even in Runtime (mxf file).

Cheers

rodolphe.koehly's icon

Thanks Michel,

But sorry, I have never used a patch in the way you left it in the post.
How do you open this with max5, please?

Chris Muir's icon
seejayjames's icon
Max Patch
Copy patch and select New From Clipboard in Max.

this has helped me to get the path, either in a maxpat or a standalone:

Guillaume Bertrand's icon

Guillaume Evrard found an elegant solution a while ago in this thread :

Max Patch
Copy patch and select New From Clipboard in Max.

I modified it a little and it now works in patcher, collective and standalone :