sprintf formatting with quotes

whitelobster's icon

I am attempting to create an instance of sprintf that always formats a section of the message with quotations around it

right now I have this as my sprintf object
sprintf script newobject newobj @text “%s” @patching_rect 20. 500. 50. 20. @varname icecreamery222

BUT the problem with this is even though I type in “%s”, after I click outside of the sprintf object it reduces the "%s" to %s, how can I format this/use sprintf in such a way that it will preserve the quotation marks? I can't use the symout argument as this will put quotations around the entire string when it only need have quotes around a chunk in the middle of the message

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

a symbol only has the double quotes when there's a space, so "%s" shouldn't exists. You can just combines the strings with prepend/append.

metamax's icon

hey thanks.. this is exactly what I needed.

michelez's icon

I am trying to send a long list of numbers through OSC and "tosymbol" only accepts 256 chars at the timje. Is there a way to add quotes to large lists?

Thanks