SFrecord and Autonaming

Jul 28, 2008 at 8:57am

SFrecord and Autonaming

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?

#39024
Jul 28, 2008 at 9:02am

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

#136837
Jul 28, 2008 at 9:09am

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

/*j

#136838
Jul 28, 2008 at 9:16am

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

#136839

You must be logged in to reply to this topic.