saving n opening files - file path
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!)
thanks
David
Hi.
welcome back. Checlout this thread:
https://cycling74.com/forums/index.php?t=msg&goto=60080&r 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
whats wrong with using savedialog and opendialog ?
simple, see below, or if i understood your wrong, sorry.
cheers,
tatsu.
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
David
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!
David