Forums > MaxMSP

SFrecord and Autonaming

July 28, 2008 | 8:57 am

OK, let’s see if I can explain this well.

I’ve set up an autonaming scheme for files recorded out of my patch – you choose a folder with a dialog (once), and then sprintf formats the date and time into a filename (with an extension), as well as shoves it at the end of the path given by the dialog box when choosing a folder.

Here’s the problem. My sprintf output generally looks like this:

"set Bonk:/Invigorator/Autonamed/7282008_15520.aif aiff"(it’s setting a message box that gets triggered when you hit ‘record’)

Which works fine. However, if there’s a space in the path, anywhere, such as:

Macintosh HD:/Invigorator/Autonamed/7282008_15520.aif
or
Bonk:/Invigorator/Autonamed Things/7282008_15520.aif

It won’t record, as SFrecord thinks there’s too many arguments (it interprets "Macintosh" as the first statement, instead of the whole path)

Any thoughts on how to fix this, or am I going to just have to avoid paths with spaces?


July 28, 2008 | 9:02 am

OK, ignore this, I figured it out. Had to put " around the pathname! Duhhhh.


July 28, 2008 | 9:09 am

run your path through a [tosymbol] object, this will add quotes if
necessary.

/*j


July 28, 2008 | 9:16 am

mushoo wrote:
> OK, ignore this, I figured it out. Had to put " around the pathname! Duhhhh.
>

or the symout argument so sprintf outputs a symbol:

[sprintf symout yourpath]
|
[prepend set]

Ciao


Viewing 4 posts - 1 through 4 (of 4 total)