Sending messages to a specified outlet with Javascript

Max B's icon

Hello, i would like to change the output value of my 'scale'-object, since creating and connecting messages would be too much overhead i would like to send the messages directly within javascript. When i send my message like this 'scalevar.message(value);' it is sent to the first inlet, which obviously scales the message but does not change any input/output values . So my question essentially is, how can i send messages to a certain inlet of an object over javascript?