Page 1 of 1

Something like "this" when Scritping

Posted: 19 Mar 2017 09:27
by AmokCop-Rob
Hi,

so when scripting something like:

Code: Select all

setattribute(GridButton56, 'color', RGB(1, 1, 1));
I want to replace the name of the component (here GridButton56) with the name of the component the script is in, e. g.

Code: Select all

setattribute(this, 'color', RGB(1, 1, 1));
Cheers,

Rob

Re: Something like "this" when Scritping

Posted: 19 Mar 2017 09:40
by AmokCop-Rob
Oh, damn. I should have read the documentation more carefully

Code: Select all

getobject()
returns the object within which the script calling the function resides. This acts effectively as a ‘self’ reference.

This was what I was looking for ;)