Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
In the first two forms, the send
keyword sends a message directly to a particular object or to HyperCard. For example, you can send a message to an object already passed by in the message- passing order (from a stack back to the current card), or you can bypass handlers later in the message-passing order that might otherwise handle the message.
You can send messages to any object in the current stack, and you can send messages to another stack (but not to objects within another stack).
Important: If you send a message to a card other than the current card, HyperCard doesn’t go to the card or open it.
For example, if you send a message to another stack, and the handler refers to a field that’s specific to that stack, you’ll get a script error.
HyperCard evaluates any parameters before it sends the message, even though the entire message is in quotation marks. (You don’t need quotation marks if the message is a single word.)
When an object receives a message from send, HyperCard sets the value of the target to the name of the object.
If the object doesn’t handle the message, the message continues along the message-passing path from that point.
If you send a message directly to HyperCard, you ensure that no other objects will handle the message. For example, send "doMenu next" to HyperCard
always takes you to the next card.
You can type send as a message in the Message box.
The third form sends a do script Apple event from HyperCard to another running application:
where program is the path name to the target program in the form zone:computer:program, and programID is the signature of a program on the same computer. this program denotes HyperCard.
expression is any valid expression or any sequence of commands in the scripting language supported by the target program. If the target program is HyperCard, the scripting language is HyperTalk.
By default, HyperCard waits for a reply from the target program before continuing; but you can specify without reply
if you don't want to wait for one.
Any reply from the target program goes into the result
.
Any text string, without quotation marks, that represents the name of the message handler you want to write:
As in:
A comma-separated list of local variable names.
The actual names don’t matter as long as they’re not the same as one of HyperCard’s reserved words. (That is, don’t use result
as a variable name.) For example:
HyperTalk Definition
The object HyperCard
, or any expression that identifies an object by name, number, or id.
For example:
AppleScript Definition
An identifiable part of an application, or a thing within an application that can respond to commands.
HyperTalk Definition
Any HyperTalk expression. All expressions evaluate to text, a number, or a constant.
For example:
Note: Formally, HyperCard distinguishes between factors (simple values) and expressions. The difference between factors and expressions matters only if you like to drop parentheses. Most functions take factors as their parameters, which is why length of 3 + 5
returns 6
and length of (3 + 5)
returns 1
. In short, always use parentheses to group things the way you want them to evaluate, and you won’t have to worry about the difference between factors and expressions.
AppleScript Definition
Any series of words that has a value.