how to deal space in folder and file name in max external [shell], [regexp] or [sprintf]?

prko's icon

Dear users,

my problem is how to correctly send following messages to the [shell]?

interactive additive synth/sonic prism.scd
interactive additive synth/sonic_prism.scd
interactive_additive_synth/sonic prism.scd

In [shell] does not work a space.
I must send a message with [sprintf], but the a space in truncate a complete path and file name.

I have also tried [regexp] with substitue. However, if a strng has no space, [regexp] does not produce the original string but nothing!

The problem is, there can be a space and also can be no space!

I tried alone some days.
I have not found a solution.

best,
prko

jvkr's icon

Does it help to put it between quotes?

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

In this regard, the tosymbol object is useful.

Gregory Taylor's icon

Alternately, he could add a backslash before the spaces, although enclosing the thing in double quotes would be easier in a situation where he always dealt with the same kind of data....

prko's icon

The two methods, I had tried.
Can you give a patch instead of a recommendation?

My actual patch is as follows:

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

goodparleyandorfing's icon

this is how to format spaces with spritf (culled straight from the helpfile)

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

prko's icon

thanks, I solved the problem.