14 March 2011

Max/MSP Javascript "find object" - lazy dollar function

The second function in my "Making Max JS less crap" series, this function scans all objects in the patch and all subpatches and returns a reference to the object with the specified scripting name: It's basically a lazy man's version of my dollar function which means you dont need to give every patcher a scripting name. The downside is it (probably) runs a bit slower. Enjoy!

Please see right hand pane before copying my code>>

function _$(id){ //search through all max objects:
    tempobj=0
    tempname=id
    this.patcher.applydeepif (_$act,_$scan);
    delete tempname
    return(tempobj)
}
function _$act(obj){
    tempobj=obj
}
function _$scan(obj){
    if(obj.varname==tempname){
        return(true)
    }else{
        return(false)
    }
}

//USAGE:
_$("myButton").message('set','new text!') //find the first object anywhere in the project that has scripting name myButton and send it a message.

16 comments:

Unknown said...

ralph lauren outlet
true religion outlet
jordan shoes
coach outlet
ugg outlet
nike air force 1
canada goose sale
gucci handbags
nike shoes
kevin durant shoes
20161228caiyan

Anbarasan14 said...

Thanks for sharing this information with us. The content was helpful to many of the readers.
Spoken English Classes in Anna Nagar
Spoken English Classes in Porur
Spoken English Class in Kodambakkam
Spoken English Class in Adyar
Best Spoken English Classes in Chennai
IELTS Coaching Centre in Chennai
Spoken English Classes in Mumbai
English Speaking Course in Mumbai
IELTS Coaching in Mumbai
IELTS Mumbai

Alexander Debrah said...

All access to ufabet direct website, not through agents Come to here, the only place in the world, the center for direct access to UFABET. All links, a complete approach to UEFA Bet Whether it is UFABET live casino online 1 day that you all gamblers have been using the service for a long time.

best quality of SEO Submission sites list said...

Blog Site Directories-- Helpforallseo Infographic Submission is constantly functioning to build high quality back links. Select an efficient directory and also choose a correct group. It takes rather some time to deliver great outcomes, yet these results stand apart over a longer period.

kinemaster Lite said...

thanks for sharing information with us.

Arnold DK said...

This is most informative and also this post most user-friendly and super navigation to all posts. Kinemaster Gold

Brain Technosys Pvt Ltd said...

The content you've posted here is fantastic because it provides some excellent information that will be quite beneficial to me. Thank you for sharing that. Keep up the good work. Android App Developers in USA

CharTec said...

Valuable information. Thanks for publishing such great information. You are doing such a great job. This information is very helpful for everyone. Keep it up. Thanks Best Msp Sales Training

Anonymous said...

Every one deserves to be happy in their family or relationships, I was lucky enough to get my husband back , Doctor Robbinson helped me he is authentic , My Husband left me for 8 months and I was devastated and couldn't find any way out to get him back i tried all ways. At some point I was depressed, while i was reading through some post on the internet where people testified about how Dr Robbinson helped them Solve similar problems I contacted him and he never hesitated to help me as well, My husband is back home, my happiness is restored
Text/call: +12267705795
Email: Drrobbinssonspiritualhome@gmail.com

Anonymous said...

I read the above article and got some knowledge from your article which is about..... It's actually great and useful data for us. Thanks for sharing it.web development

Cisin said...

This is a great article you've shared because it offers some great information that will be very helpful to me. I'm grateful that you said that. Work well done; continue.artificial intelligence

Anonymous said...

I read the article you linked to above, and I learned a little something from it. For us, the information is genuinely quite good and helpful. We appreciate you sharing it.hire programmers in india

Anonymous said...

We've noticed that this article is well-informed, in my opinion. The essay is beneficial to us, and your writing is exceptional. We appreciate you sharing this content.hire coldfusion developers

Alia parker said...

Enterprise Risk Management Software assists in tracking and managing compliance with industry regulations and standards, reducing regulatory risks.

Mobile App Development Company in Bangalore said...

Thank you very nice sharing.

mounikavcube said...

This is a great article you've shared because it offers some great information that will be very helpful,keep posting.
python training in kukatpally

Post a Comment

Cron Design Studio: Dublin based web design & software development