Name: me

Type: keyword

Syntax: me

Summary:
Equivalent to the <object(glossary)> that contains the currently running
<handler>. 

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
set the borderWidth of me to it

Example:
put the short ID of me into tSavedID

Example:
put me into myVariable -- puts contents, if me is a container

Example:
put me into myVariable -- puts name, if me is not a container

Description:
Use the <me> <keyword> within a <handler> to determine which
<object|object's> <script> is <execute|executing>.

The <me> <keyword> is a reference to the <object(glossary)> whose
<script> contains the current <handler>. If <me> is executed in a
<behavior> <script>, then <me> refers to the object that is executing
the <behavior> <script>.

If the currently executing handler is in the script of the object that
received the original message, then <me> is the same as the
<object(glossary)> whose <name> is <return|returned> by the <target>
<function>. For example, suppose a <button(object)> <script> contains a
<mouseDown> handler. The value of the <target> <function> within that
<mouseDown> <handler> is the same as the name of me: the name of the
button. 

However, if the mouseDown <handler> is in the <card(object)|card's>
<script> instead of the <button(object)|button's>, <me> is not the same
as the <object(glossary)> specified by the <target>. In this case, <me>
is the <card(keyword)>, but the <target> <function> <return|returns> the
<button(object)|button's> name, because the <button(object)> is the
<object(glossary)> that first received the <mouseDown> <message>.

The <me> <keyword> can be used anywhere an <object reference> is used.

References: dispatch (command), function (control structure),
menuButton (function), target (function), object (glossary),
return (glossary), handler (glossary), button (glossary),
execute (glossary), message (glossary), keyword (glossary),
object reference (glossary), card (keyword), mouseDown (message),
card (object), button (object), script (property), behavior (property),
name (property)

Tags: objects

