Object was not created by the script , the object have got a "script name" that can be easily adresed with a "script …." message sent to a "thispatch" object.
What is the syntax within javascrip to adress the named object directly ?
I know I can outlet a message connected directely to the "thispatch" object but what I’m looking for is a wireless method .
The second level of my question is how to adress objects that are within a subpatch or bpatch ….
function dostuff (x,y)
var obj = this.patcher.getnamed(x);
----------begin_max5_patcher---------- 509.3ocyVF0bhBCDG+Y3SQFl6siyIITzXeqeNtoSmnD03.INjPq20oe2qYC3 osUAU7rOPXxlvx+8G6tgWCChlnWKLQn6Q+FED7ZXP.XxYHnddPTAe8zbtA1V TgvX3yEQw90rh0VvtRq1ZbE2NcgTM+oRwTq24TFc.NFQnD2sQvHgM.idr9Yl oUVEuP.N6gRIOuwappBoJWXg2O8eF0U1FqjcbhQ9WvID2KzaVlAdUOY4uHoM t0+31+rR3UXTD5Q2JuEF5Fh6HOThW132OgiE5mEkGgGIz6bHX7P2X53AowHJ 9zwA4KwwccGGIGFGw6bcdnopXxQgvPFjLjBL.6F6OFP6NCnGjARk0E9S3p4m GBNT0Rl1XqlMCYWHVkWYPziPIhGSiGA0LX7MqzA2ykNc.Na9.f9Ao0THOa7E S2Bzv9+zTYoAMW.wS1fklVoBgB4JLV+VY0crLruwRaMTpKUn3abKkzqWGk8S MdlWtMbp6k7orlehRZGYDVh6VB8bOI5RKgRNJx5gzkOfJ3CQaEPdnb6xiNiS l.IFkKUe725fnzYeehYzUkSa7ZyuDfHaizLgwJUbqTq1cSo6soExrLArdSPT HyVo2HxZQbfuemjlveyzDsCZhs2dt5RB2AIM7zjDYzHWKABANhcmIWnVY8uT uPE0kbrzKPQal7V36.28Y7B -----------end_max5_patcher-----------
thank you lh,
the "getnamed" was the missing key for me .
sorry for posting in the bad forum .
Just an extra pointer: for non UI objects you might need to change this to:
If you open the object inspector you can drag an attribute on to your main patch and it will create a message box with the message format already in place, this will make it easy to figure out what you need to send in your js message.
thank you so much lh, very helpful hint .
just want to add, if you don’t need the messages instantiated into your patch(i.e. you just need to know what they are in order to enter into your js code), you could simply open up the inspector, click the "@" symbol at the bottom left of the inspector and this will open up the entire list of attribute names for every available attribute right there in the inspector(although maybe you still want to drag since the instantiated messages will also show whether you need one or more arguments to the message).
thank you RabidRaja,
may be I can ask another question please ….
I posted a new topic about accessing objects within a bpatcher in the javascrpit forum (I don’t know how to insert here the link to that topic, sorry)
Can you have a look at it please.
Thanks in advance .