Have a look at this patch! The ‘thispatcher’ object can connect objects’ or patchers’ outputs and inputs by sending scripted commands.
The script is pretty straightforward: you start the message with the word ‘script’ then add the action you want to perform (connect or disconnect). The pairs of letter and numbers define the outputs/inputs to be connected. ‘p1’ and ‘p2′ in this case are the scripting names of the objects. To add a scripting name you need to open the objects’ inspector (Cmd+i) and add a name of your choice (Hint >’scripting name’). You might find it easier to name your object after the function it performs. For instance, an LFO patcher would get the scripting name ‘lfo’ for convenience. The input/output numbers always start with zero. Add a serial object and you can remotely patch up stuff in Max! Wohoo!