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

Aug 12, 2011 at 11:31am

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

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,

#58441
Aug 12, 2011 at 11:48am

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,

#210027
Aug 12, 2011 at 4:18pm

I use Javascript like Patrick Delges said.

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

And, there is my patch

– Pasted Max Patch, click to expand. –

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

#210028
Aug 12, 2011 at 6:39pm

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?

#210029
Aug 12, 2011 at 7:41pm
#210030
Aug 12, 2011 at 9:23pm

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

– Pasted Max Patch, click to expand. –
#210031
Jan 9, 2012 at 11:18am

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

http://cycling74.com/forums/topic.php?id=29263&replies=10#post-181481

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

– Pasted Max Patch, click to expand. –
#210032

You must be logged in to reply to this topic.