Page 1 of 1

I need to know who sent a message

Posted: Mon Nov 30, 2009 12:49 am
by ale870
Hello,

in a event I can use "me" to get a reference to the script owner. Is there a keyword to know who raised the message?
For example:

BUTTON_1:

Code: Select all

on mouseUp
  send "go" to button "BUTTON_2"
end mouseUp
BUTTON_2:

Code: Select all

on go
  answer "This message was arised by..." && sender
end go
In this example, "sender" is not a keyword, but please take only the concept. In BUTTON_2, how can I get the name of the message sender (in the example it it BUTTON_1).

Thank you!

Re: I need to know who sent a message

Posted: Mon Nov 30, 2009 7:14 am
by Janschenkel
You can get at it via the executionContexts property; but the more important question is: why do you want to know? You can always pass more information to the second handlker in the form of a parameter. Also make sure to read this article by Richard Gaskin on the message path and how this chain of command allows you to better structure your application.

HTH,

Jan Schenkel.

Re: I need to know who sent a message

Posted: Mon Nov 30, 2009 9:09 am
by ale870
Ok, thank you!