To assign a variable name to my js object I have just written var x=this; which gives the js object the global variable name "x". I can then use its outlets, or create new objects from other js patches just by writing x.outlet(0,"bang"); How can I assign a variable name like this to the other patches in in my Max session (both subpatchers and normal)?
When I **create** the objects from js it is easy, because I can say z=this.patcher.newdefault(20,200,"message"); and the message box will be called z, but what about objects already made from the palette?
Okay, I think I see!! Thank you for your clarification.
So then, to create a message box in that subpatcher the code would be: var sp = this.patcher.getnamed("yourSubpatcherScriptingName").subpatcher()
var myMessage=sp.newdefault(30,100, "message");
And if there were a number box with varname "mm" would it be set at sp.getnamed("mm").set(4);
And yes, I guess that a patcher inside a patcher is a subpatcher (duh!), I just got confused because rather than making a patcher object (and typing p newPatcher), I just used a patcher I made that was saved in the search path.