Skip to main content

Dialog Builder

What Is Dialog Builder?

Dialog Builder is a useful feature that allows you to create interactive dialogs within your macro. These dialogs are typically used to gather input from users before the macro begins its main execution. Think of it as a way to customize your macro's behavior based on user choices.

For example, you could create a dialog that asks, "Which option would you like to run?" If the user selects option 5, the macro would then perform a specific set of actions associated with that choice.

Dialog Components

Dialogs are constructed using various UI components. Each dialog can include the following elements:

  1. CheckBox: For yes/no or true/false selections
  2. EditText: For free-form text input
  3. RadioGroup: A container for multiple RadioButtons
  4. Column: A vertical layout container
  5. Row: A horizontal layout container
  6. RadioButton: For single-choice selections within a RadioGroup
  7. TextView: For displaying text information

Building Your Dialog

You can combine these components to create a custom dialog that suits your macro's needs. Among these components, there are three input types from which you can retrieve values:

  • CheckBox
  • EditText
  • RadioGroup

To access the values from these input components, you can use the Dialog:getValueById() function in your macro logic. By specifying the component's unique ID, you can retrieve the user's input and use it to guide your macro's actions.

Note: Each component in your dialog must have a unique ID. This ensures that the macro can correctly identify and retrieve values from the specific component you're targeting. Duplicate IDs may lead to confusion and errors in your macro's execution.