Hmmm... "me" and "the target" seem to return the same value, whether in a behavior script or in the original control. I think that's proper, so I'm not suggesting changing it.
They are actually different - me is essentially an analog of 'self' (obj-c) or 'this' (c++) - it is the object that is executing the current handler (and just like self/this it is the descendent object if the handler is actually in a behavior); whereas 'the target' is the object to which the message was originally sent.
The missing piece is getting the object that actually owns the script the current handler is within - i.e. if it was a handler in a behavior, then it would be the behavior object and not the object using the behavior (which is me). Indeed, the generalization is something that returns the object owning the script the current handler is implemented in - i.e. like 'me' but it would change depending on whether the script was a behavior or not.
To clarify, let's say we have a field implementing a handler 'foobar', and the field has its behavior set to a button which implements a handler 'foobaz':
Code: Select all
send "foobar" to field
the target - field
me - field
'the scriptObject' - field
send "foobaz" to field
the target - field
me - field
'the scriptObject' - button