Odd [coll] behavior?

Brian H.'s icon

Hi,
Running into a few things I'm not able to explain after looking at the docs and searching the forum.

I have a small [coll] in a patch with data I want pre-set and saved with the patch. I created the [coll], named the data ([name].txt) and saved that in an external file as well, checked the save with patcher box in the inspector.

But I wanted to edit the data, and no matter what I do I can't get the edits to be saved-- It always reverts to the un-edited data. Shouldn't this update if the Save with Patcher box is checked and I choose to save the [coll] data and patch when closing? I even tried ripping it out and re-making it, but get the same behavior.

Possibly related or not, all of a sudden when I save a patch, rather than just saving quietly, I ALWAYS get the Save dialog and have to replace the old patch file. Never had that happen before.

I should add that I did just move these files to a new directory and added it to my File Path list before these problems started. But that seems pretty straightforward, and I can't see how that could be causing complications.

Make any sense? I'm new, so maybe missing something about how [coll] data operates here?

Thanks,
Brian

Mattijs's icon

Moving this post from the archives to the MaxMSP forum.

Luke Hall's icon

If you update a [coll] which has "save with patcher" selected it should save the collection contents with the patch whenever the patch is saved. It will not save the new contents to the external file unless you send the "write" message again. Do you have a loadbang reading the name.txt file from your hard drive as this will overwrite the original data stored in the [coll].

In my experience saving the collection contents as an external text file isn't really necessary, just saving the contents with the patch serves me well. Also check that you don't have a naming conflict: if you have another [coll] with the same name in another open patch then you might be reading the wrong information. You can use the #0 prefix to give a unique name to all instances of #0 within your patch if you need to.

lh

Brian H.'s icon

Thanks for the ideas. So then this [coll] is *not* behaving as expected for some reason. It is not saving new edits with the patch, but keeps reverting to the first data set that was put it. I saved externally just as a precaution (good thing I did!). This is the only [coll] in this patch. It is below, if anyone cares to look. It is just the beginning of an idea, so not much there at the moment. But the thing with going to the Save dialog and having to replace every time seems weird also. I did check the permissions on folders just to be sure there was nothing amiss there.

Any ideas?

Thanks,
Brian

=

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

Exit Only's icon

I may be misunderstanding you problem, but keep this in mind-

when coll is first loaded, it looks for a text file with the same name as its first argument. It is possible that you could tell coll to save the data with the patcher, which it does......

not altering the saved text file.

However, when you load the patch again, coll looks for that text file and replaces the data-saved-in-patcher with the data from the text file.

To solve this problem I would simply change the name of the coll and/or add a 1 as a second argument which tells coll to not look for a text file with that name.

Note that this will erase the data currently in the coll. To remedy this, first (before changing the coll name) open the coll, copy all of the text and close it. After renaming, open it, paste the text and close it (and save when the dialog pops up). Dont forget to re-check 'save data with patcher'

Brian H.'s icon

Thanks-- That is helpful, as I didn't really understand the interaction between a specified file and the embedded data.

However, I'm not sure the behavior of my patch is making sense.

First off, if I choose to specify an external file as an argument, and that file is edited (let's say Max isn't even running), shouldn't the current data in that file come-up when I open the [coll] to look at the contents? That's not happening, even when I uncheck Save Data with Patcher.

Then I tried both adding the 1 and then removing the name of the [coll], opening the contents again, pasting in the data I wanted, and Save With Patcher-- It reverts again to the data from the previous [coll], which I would think it shouldn't even know about at this point!

Maybe I'm just not getting something basic here?

Continued thanks,
Brian

Brian H.'s icon

So maybe this is one for tech support? With all the prompting during saving, I just wonder if things are actually working correctly?

Thanks,
Brian

Brian H.'s icon

Just as an FYI: This is finally resolved. The file saving issue was because I had moved some data to a path that had a "/" in the name. The [coll] saving issue was expected behavior-- My change to the data was merely adding extra '0' decimal points, and Max was truncating them, which is apparently normal.

Thanks all,
Brian