Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » script

Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.

script

set [the] script of object to text

The script property returns or sets a text string equal to the script of the specified object in the current stack or in the stack script of another stack.

When you set the script property with the set command, you replace the existing script entirely.

Examples

get the script of card 1
if "mouseUp" is not in it then addMouseUpHandler it
set the script of bkgnd field "Index" to ¬
the script of bkgnd button "Index"
set the script of stack "My Stack" to empty

Demo Script

on scriptDemo
answer "The script of this field is:" & ¬
return & return & the script of me with "OK"
end scriptDemo

Related Topics

Placeholders

object

HyperTalk Definition

The object HyperCard, or any expression that identifies an object by name, number, or id.

For example:

HyperCard
me
[the] target
button 1
background part 6
card field id 3894
this card
next background
stack "My Stack"

AppleScript Definition

An identifiable part of an application, or a thing within an application that can respond to commands.

text

An expression that evaluates to a text string.

A text expression can be a literal string surrounded by quotation marks or the value of a container.

For example:

"Hello"
"The sum is:" && 3
card field 1
line 1 of bg fld "Address"
the Message box
the selection
myVar -- a variable

See also: background, bkgnd, button, card, field, menu, menuItem, and stack

HyperTalk Reference

Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Retro View