What is scripting name/var name for?

startec's icon

Can anyone explain to me how I should/can use the "scripting name" attribute in javascript?
In the inspector I can see it is the same thing as the "varname" property, but I am not sure exactly what this helps me do.

It seems like this could somehow be used to access the various objects in the patcher but I have tried
var x=this.patcher.getnamed("setvarname");
function bang(){
    x.outlet(0,"hello");

And that-and any variations, do not work. Thanks for any input.

do.while's icon

Hi !
varname is a scripting name for your JS api , so you can find it inside your patcher easily through JS
for example this way :

var myObject = this.patcher.getnamed("yourScriptingName"); // lets say numbox has varname of "yourScriptingName"

function bang(){
    myObject.message("int",9);
//or
    myObject.int(9);
}