Skip to main content

DISPLAY_CHOICE

Description

The DISPLAY_CHOICE is a display command that asks users to choose an item from a specified list.

Syntax

DISPLAY_CHOICE {
"title": "List Title"
"choices": [{
"name": "Choice Name"
"title": "choice1"
"icon": "IconName"
}]
}

Arguments

  • choices: specifies all options for choice menu with the following parameters -
    • icon: specifies image file name only
    • name: displayed on-screen name for a choice
    • title: references target programs to run when choice is selected
  • id: unique name in the event (optional)
  • timeout: specifies menu selection timeout value in seconds
  • title: choice menu title

Example

Input

ON "choice_made" AS C {
DISPLAY C.title
SLEEP 2
RUN C.name
}

DISPLAY_CHOICE {
"title": "Please choose an option."
"choices": [{
"name": "Play a message"
"title": "HEBmessage"
"icon": "RecordVoiceOver"
},{
"name": "Tell a joke"
"title": "joke"
"icon": "Pets"
}]
}

Output

Screen will display "Please choose an option." and provide the list of choice options with specified icon and title. Upon selection of a choice option, the specified resulting program will run based on the ON condition.

Resources

Explore the SaviScript GitHub repository for all published instances of this command.