Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference »

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

clickChunk

the clickChunk

Value returned: character chunk expression equal to the word the user clicked or the longest range of characters with the text style Group around the character that the user clicked (if the text has been grouped)

The text style Group allows the clickChunk to extend beyond word boundaries.

The chunk expression returned has the following form:

char posInteger to posInteger ¬
of container

Examples

put the clickChunk into theChunk
select theChunk
put the value of the clickChunk into theChunkClicked
put the textFont of the clickChunk into theFont
put the textStyle of the clickChunk into theStyle

Demo Script

on clickDemo
toggleActiveText true -- make sure grouped text is visible
answer "Click any text in the Demo Script." & return & ¬
"Click text with the gray underline (grouped text) to get phrases."
wait until the mouseClick
get the clickChunk
select it
wait 1 second
answer "The chunk of text that you clicked was “" & it & "”."
end clickDemo

Related Topics

Placeholders

posInteger

An expression that evaluates to a positive integer.

For example:

3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2

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

container

HyperTalk Definition

A place where you can store and retrieve a value.

There are six types of containers in HyperCard: a variable, a button, a field, the selection, the Message box, and menus.

myVariable
[the] selection
the Message box
btn 3
bg btn "Names"
card field 1
bkgnd field "Total"
menu 2
menu "Edit"

Additionally, you can refer to a button or field by its part number:

card part 1
last background part

AppleScript Definition

An object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of or in.

You can also use the possesive form ('s) to specify containers. For example, in

first window's name

the container is first window. The object it contains is a name property.

HyperTalk Reference


Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Modern View