Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Properties

Note: This is a work in progress and will be formatting errors. 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 ...

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)


Related Topics

« checkMark | HyperTalk Reference | cursor »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View