HyperTalk Reference
Home » HyperTalk Reference » Commands

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.


request expression from|of program ¬
request expression from|of ¬
   program id programID
request expression from|of ¬
   this program
request appleEvent data|class|id| ¬
   sender|return id|sender id
request appleEvent data ¬
   with keyword aeKeyword

Expression yields an expression understandable to the target program.

From and of are interchangeable.

Program yields a valid program path name in the form

zone:targetComputer:targetProgram where targetProgram is the name of a program running on computer targetComputer in network zone zone . ProgramID is the application’s signature. AeKeyword is an Apple event keyword.

The request command sends an “evaluate expression” Apple event from HyperCard to another application.

You can use this command to send an expression to any program that understands the standard eval Apple event.

The expression you use must be understandable to the target program. For example, if the target program is another HyperCard, the expression can be any valid HyperTalk expression.

When the target program executes the statement, the result of the request (the value of the expression) goes into the local variable it.

If the target program reports an error, HyperCard sets the result with an error message.

You use the request appleEvent forms to examine the data and attributes of an incoming Apple event.

You can omit the zone parameter from the program path name when the target computer is in the same zone as the source computer.

You can omit the targetComputer parameter if the target program is running on the same computer as HyperCard.

You can pass the user selection from the answer program command as the program parameter.

Demo Script

on tellTheStack
   -- this demo only works with System 7 
   if not systemSeven() then exit tellTheStack
   request "the name of this stack" of program ¬
   (the short name of HyperCard)
   answer "This is" && it & "."
 end tellTheStack

 function systemSeven
   return the systemVersion ≥ 7.0
 end systemSeven


HyperTalk DefinitionAny HyperTalk expression. All expressions evaluate to text, a number, or a constant.

For example:

"this is" && it
(3+2) = 5
the heapspace div 1024

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 DefinitionAny series of words that has a value.

Related Topics

« reply | HyperTalk Reference | reset »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View