setting message obj arguments with object.message( )

L4Z3RC47's icon

Hello All,

I'm having a little bit of an odd problem with some js being used to dynamically create and set message boxes for routing of OSC data. I have no problems getting info into my message boxes however max is adding quotation marks to my messages thus nullifying the messages usability as an OSC encoder.

Here is some code:

// ...in with the new
        numinlets = a; // update our global number of inlets to the new value
        if(numinlets) theudpsend = this.patcher.newdefault(300, 300, "udpsend", "localhost" ,8369); // make the udpsend
        for(k=0;k

you can see where i am setting the message boxes with "control mess[k].message("set" , "/" + (this.patcher.name)......"

Whats I'm expecting is a message box set to read: /thispatchername/button/argumentname $1

What I am getting is: "/thispatchername/button/argumentname $1"

Does anyone know why I'm getting these quotation marks added to my messages?

Thanks in advance!

L4Z3RC47's icon

Note: I also tried to use sprintf objects instead of message objects however I was unable to get a space into the argument for the object.

I wanted to get: /thispatchername/button/argumentname %s

I was only able to get: /thispatchername/button/argumentname%s

adding a space anywhere in the sprintf refused to populate the object with the argument on creation without an error and I simply got empty object boxes.

do.while's icon

Hi . did you tried [fromsymbol] ?

L4Z3RC47's icon

from symbol object works to strip the quotation marks off of the message however the initial message that is connected to the patchers inlets still has the quotation which render the $1 argument ineffective. Is there a way to set the message box with JS so that it receives a message as an argument rather than a symbol?

L4Z3RC47's icon

Ok, so maybe this is a weird bug?

If I add the $1 to the message using append instead of the normal all in one string then I get rid of the annoying quotations.

controlmess[k].message('append', '$1');