Something like "this" when Scritping

Discuss Lemur and share techniques.
Post Reply
AmokCop-Rob
Newbie
Posts: 4
Joined: 21 Feb 2017 10:15

Something like "this" when Scritping

Post 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
AmokCop-Rob
Newbie
Posts: 4
Joined: 21 Feb 2017 10:15

Re: Something like "this" when Scritping

Post 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 ;)
Post Reply