Specify and auto-save a buffer content

Ricardo's icon

I was wondering if anyone knows how to specify where buffer saves its content? I know that if you use the message "write" the dialog box opens, but if you provide the the message "write" with a symbol it just auto-saves in the default folder. Usually where the patch is saved. But what i was wondering was if there is a way to change that default folder so it auto-saves to another folder?

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

goodparleyandorfing's icon

just specify the filepath after the write command.
write "Macintosh HD:/Users/roadrunner/Desktop/beepbeep.wav"

Ricardo's icon

hmmmm, yes it works, except that my .aiff files becomes plain text files. I cant open them as sound files.

Any thoughts?

And thanks a bunch for looking at this problem for me.

Ricardo's icon

Figured it out. THanks again.

Luke Hall's icon

This sounds like a system issue rather than a max issue. If you're on a mac then right click one of your .aiff files and select "Get Info". Then in the "Open With" section select your chosen audio program like QuickTime or iTunes etc and make sure that it says "Use this app to open all similar files" (or some such phrase). That should fix the problem. I'm sure there is an equivalent method if you're using windows too.

lh

Ricardo's icon

It was a typo. I wrote ".aiff" instead of ".aif".

Here is the working code.
I'v implemented a "#0" so it can be loaded into bpatches without the possibility of generating an equal file name.

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

Ricardo's icon

SORRY! HERE IS THE CORRECT CODE:

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

Luke Hall's icon

Check out the [date] object if you want a way of automatically including it in your file names.

lh

Ricardo's icon

Thanks. I will.