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.

commandChar

set [the] commandChar of menuItem ¬
of menu to char

The commandChar property returns or sets the character that you'd press with the Command key as the keyboard shortcut (commonly called the Command-key equivalent) for a menu item.

If the menu item has no Command-key equivalent, the property returns empty. Otherwise, it returns the character.

If more than one menu item use the same command character, the menu item on the menu farther to the right takes precedence.

Examples

set the commandChar of menuItem 3 of menu "Help" to "?"
get the cmdChar of second menuItem of menu "File"
if it is "O" then ...

Related Topics

Placeholders

menuItem

An expression that evaluates to one of the following:

menuItem text
menuItem posInteger
ordinal menuItem

For example:

menuItem "New"
menuItem 2
second menuItem

menu

An expression that evaluates to one of the following:

menu text
menu posInteger
ordinal menu

For example:

menu "File"
menu 2
second menu

char

An expression that yields a single character.

For example:

"a"
return
tab
numToChar(13)

HyperTalk Reference


Version 0.8b4 (July 4, 2025)

Made with Macintosh

Switch to Modern View