Is there a way to refer to the object that a script is acting on? What I mean is if I'm doing something like the following:
round(x*getattribute(MultiSlider, 'nbr'))
I would like to change MultiSlider to something like 'this' or 'self' so that I don't have to go in and edit the script every time I make change the name of the object or make a copy of the object.
Thanks,
-Nick
refer to self (this)
Re: refer to self (this)
Hi
I think you want 'getobject()' passing nothing as the argument returns the enclosing object , ,
Use it by declaring something like
decl this = getobject();
out = round(x*getattribute(this, 'nbr'));
Can also be used to get/store references to any object
An implicit 'this' function has also been requested on the wishlist from memory . . .
Cheers
MM
I think you want 'getobject()' passing nothing as the argument returns the enclosing object , ,
Use it by declaring something like
decl this = getobject();
out = round(x*getattribute(this, 'nbr'));
Can also be used to get/store references to any object
An implicit 'this' function has also been requested on the wishlist from memory . . .
Cheers
MM
iMac 2.8G i7 12G 10.6.8/10.7.2, Legacy Dexter/Lemur, Liine Lemur/iPad2, KMI SoftStep, 12Step & QuNeo , B-Controls, Mackie C4 etc
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
MaxMSP, Live Suite, Native Instrument stuff, etc Modified Virtual Guitar System etc All Projects/Modules © CC-BY-NC-SA[*][/b]
Re: refer to self (this)
Thanks for asking about this Nick i've been asking myself how to do this, but have just moved on and continued working.
Macciza thank you sir for the answer! I remember someone asking for a ob ref 'this' as well.
Macciza thank you sir for the answer! I remember someone asking for a ob ref 'this' as well.
Macciza wrote:Hi
I think you want 'getobject()' passing nothing as the argument returns the enclosing object , ,
Use it by declaring something like
decl this = getobject();
out = round(x*getattribute(this, 'nbr'));
Can also be used to get/store references to any object
An implicit 'this' function has also been requested on the wishlist from memory . . .
Cheers
MM
Dashboard gear control templates: User 112 Idx :: LModIt Lite :: SVG image converter for Lemur Canvas