get scripting name hierarchy of nested bpatchers

Dec 11, 2013 at 5:35am

get scripting name hierarchy of nested bpatchers

Dear forum,

I am aware of and have many times used this javascript from Luke Hall (thanks!):

outlets=1;

function bang()
{
if(this.patcher.box){
outlet(0, this.patcher.box.varname);
}
}

to get the scripting name of a bpatcher from inside itself.

I’m wondering if it’s possible to use a similar method to find out the scripting names of all of the parent bpatchers when dealing with nested bpatchers, each with their own scripting name.

I’m looking for something that will spit out the scripting names in hierarchical order (up or down) so that I can then convert it to this:

top_level::middle_level::bottom_level

where each xxx_level is the scripting name of the bpatcher (from topmost to the current one).

Is it possible with a bit of js code like that above or any other similar (seemingly) simple method?

This is for a large project that includes the ability to dynamically create bpatchers within bpatchers within bpatchers etc and I want to be able to turn any arbitrary nested child bpatcher’s active state to pattrstorage on/off which is only possible when using the syntax:

“active top_level::middle_level::bottom_level $1″

Thank you for your help/time!

Joe

#275410

You must be logged in to reply to this topic.