saving n opening files - file path

    Apr 21 2006 | 5:57 pm
    hi all,
    for the first time in many years of maxing, I'm attempting to put together a proper save/load system for the patch I'm building. I've been looking through the help files and manual, but it's not making any sense to me.
    My patch creates audio buffers with associated coll files (the coll contains a list of audio segments in the buffer~, created with record~ in append mode).
    I want to save both buffer and coll with similar names - ie the user enters a filename using textedit, and then an aiff file and a coll text file are saved with the same name (but obviously different file types). and then I'm going to want to do the same in reverse (ie load the two related files).
    I used to do this as two separate operations, but that's untidy, which is why I want to do it as a single (as far as the user is concerned) operation. I'm also trying to avoid having the user open a save dialog as that does require the 2 separate save dialogs - one for the buffer and another for the coll.
    So I want the user to enter a filename, click on a button, and then everything else happen in the background.
    I've figured out how to use textedit instead of dialog, so that bit's done. And I've managed to get coll to save using [prepend write] following the file name. The thing I'm currently having problems with is setting the file path - I want to save the files in a specific folder inside the patcher folder. I need to tell both coll and buffer~ to use this path for these specific save and load operations.
    Can anyone give me any pointers as to how to go about doing this (asuuming that it's possible!)

    • Apr 21 2006 | 6:24 pm
      Hi. welcome back. Checlout this thread: id=0&S=f2cb293332080bf4e9ae814dbf484984&srch=Specifying+save +path#msg_60080
      on that issue. I got to it by searching for: Specifying save path
      best, wes
    • Apr 21 2006 | 6:34 pm
      whats wrong with using savedialog and opendialog ? simple, see below, or if i understood your wrong, sorry. cheers, tatsu.
    • Apr 21 2006 | 11:14 pm
      hi tatsu,
      thanks for that. the missing ingredient for me was [sprintf] - another object that I've managed to avoid getting my head around before now. Getting the write message on the front of the filepath was what i couldn't get working. I've assumed that the [ascii] object in the sub-patch is the same as [itoa]/
      thanks again
    • Apr 21 2006 | 11:16 pm
      thanks Wes,
      you may already have seen in my previous reply that [sprintf] was the missing ingredient. I also noticed whilst working on this that I still haven't gotten my head all the way around the symbol/message thang in max. Time for some more brain enhancing smart pills!