Menus

Table of contents

  1. Choose From Menu
  2. Choose From List

Choose From Menu

The syntax for a menu is very similar to a switch statement. Use the following syntax to create a menu:

menu "Prompt" {
    item "Item 1":
        /* do stuff if selected... */
    item "Item 2":
        /* do other stuff if selected... */
}

The menu prompt can be a variable or a literal value, as can each item label.

Choose From List

Create a variable with a list() action as its value.

Like in Shortcuts, each item must be text, but you can still use inline variables.

@list = list("Item 1", "Item 2", "Item 3")

Then, use the chooseFromList() action with the list and prompt.

@list = list("Item 1", "Item 2", "Item 3")
@chosenItem = chooseFromList(list,"Choose a item")

The variable chosenItem in the example would hold the item chosen from your list by the user.


Copyright ©. Distributed under the GPL-2.0 License. Siri Shortcuts and Mac are registered trademarks of Apple Inc. Apple is not involved in this project in any way. Do not contact Apple Support unless you are having an issue with the Shortcuts app itself.