• grandMA3 User Manual
    • About the Help
      • Open the help in the console
      • Open the help in the web
      • Open the help as pdf
      • Navigate in the help
    • Device Overview
      • grandMA3 consoles
        • grandMA3 full-size
        • grandMA3 full-size CRV
        • grandMA3 light
        • grandMA3 light CRV
        • grandMA3 compact XT
        • grandMA3 compact
      • grandMA3 extension
      • grandMA3 replay unit
      • grandMA3 processing units
      • grandMA3 nodes
      • grandMA3 nodes DIN-Rail
      • grandMA3 I/O Node
      • grandMA3 I/O Node DIN-Rail
      • grandMA3 onPC command wing XT
      • grandMA3 onPC command wing
      • grandMA3 onPC fader wing
      • grandMA3 onPC rack-unit
      • Screen allocation
      • Keyboard shortcuts
        • Framework shortcuts
      • Keys
        • . [Dot]
        • <<< [GoFastBackward] | Black
        • >>> [GoFastForward] | Flash
        • - [Minus]
        • + [Plus]
        • / [Slash] | * [Asterisk/Multiply]
        • At
        • Assign
        • Align
        • Blind
        • Clear
        • Channel
        • Copy
        • Ctrl
        • Cue
        • Down
        • Delete
        • Esc
        • Edit
        • Freeze
        • Full
        • Fixture
        • Group
        • Goto
        • Go+ [large]
        • Go- [large]
        • Go+ | Temp
        • Go- | Top
        • Help
        • Highlt [Highlight]
        • If
        • Learn | Rate1
        • List
        • MA
        • Menu
        • Move
        • Next
        • Numeric keys | arrows
        • Oops
        • On
        • Off
        • Pause [large]
        • Pause | Fix
        • Page+
        • Page-
        • Please
        • Power
        • Preset
        • Prvw [Preview]
        • Prev [Previous]
        • Select
        • SelFix [SelectFixture]
        • Sequ [Sequence]
        • Set
        • Solo
        • Stomp
        • Store
        • Thru
        • Time
        • Up
        • Update
        • U1
        • U2
        • X1 | Clone
        • X2 | Link
        • X3 | Grid
        • X4 | Layout
        • X5 | Step
        • X6 | TC
        • X7 | View
        • X8 | DMX
        • X9
        • X10
        • X11
        • X12
        • X13 | Phaser
        • X14 | Macro
        • X15 | Page
        • X16 | Exec
        • Xkeys
      • Control elements
        • Command area
        • Master area
        • Custom area
        • Dual encoders
        • Level wheel
        • Grand master
        • Executor elements
      • Connector pin assignment
      • UPS battery
    • System Overview
      • Standalone device
      • Locally networked devices
      • World server
      • Parameters
        • Calculate parameters
        • Expand the amount of parameters
    • First Steps
      • Unpack the device
      • Check scope of delivery
      • Position the device
      • Connect power
      • Connect desk light
      • Connect external screens
      • Connect USB devices
      • Connect DMX
      • Connect Audio In
      • Connect MIDI
      • Connect LTC
      • Connect Ethernet
      • Connect DC Remote In
      • Connect grandMA3 extension
      • Connect grandMA3 fader wing
      • Turn on the device the first time
    • grandMA3 onPC
      • System requirements
      • Windows™® installation
      • Optimize Windows™®
      • macOS® installation
      • Optimize macOS®
      • onPC Terminal App
      • onPC settings
    • Show File Handling
      • Load show file
      • Save show file
      • New show file
      • Backup, demo and template show files
      • Organize show files
    • Workspace
      • User interface
        • Configuration of displays
        • Desk lock
        • User-defined area
        • Command line
        • Control bar
        • View bar
        • Tables in general
        • Trackpad window
      • Gestures
      • Command area
      • Oops overlay
      • Master controls
      • Playback controls
      • Displays in grandMA3 onPC
      • Encoder bar
        • Feature group control bar
        • Encoder toolbar
      • Calculator
      • Playback bar
      • Command wing bar
      • Colors
        • System
        • Markers
        • Color theme
        • Compare tool
    • Command Syntax and Keywords
      • Syntax rules
      • Parent child concept
      • General keywords
        • ; [Semicolon]
        • / [Slash]
        • . [Dot]
        • = [Equal]
        • <<< [GoFastBackward]
        • >>> [GoFastForward]
        • - [Minus]
        • * [Asterisk]
        • % [Percent]
        • + [Plus]
        • Absolute
        • Acceleration
        • Action
        • ActivationGroup
        • Agenda
        • Align
        • AlignTransition
        • Appearance
        • Assign
        • At
        • Attribute
        • AutoCreate
        • Black
        • Blind
        • Block
        • BPM
        • Call
        • CancelSoftwareUpdate
        • Camera
        • Capture
        • ChangeDestination
        • Channel
        • ChannelSet
        • Chat
        • ChatJoin
        • ChatLeave
        • CleanUp
        • Clear
        • ClearActive
        • ClearAll
        • ClearSelection
        • Clone
        • CommandDelay
        • Collect
        • Collection
        • Color
        • ColorDefinition
        • ColorTheme
        • Configuration
        • Console
        • Cook
        • Copy
        • Cue
        • CueAbsolute
        • CueDelay
        • CueFade
        • CueInDelay
        • CueInFade
        • CueOutDelay
        • CueOutFade
        • CueRelative
        • CueUpdate
        • CurrentEnvironment
        • CurrentUser
        • CurrentUserProfile
        • Cut
        • DataPool
        • Deceleration
        • Decimal8
        • Decimal16
        • Decimal24
        • Default
        • Delay
        • Delete
        • DeleteOtherVersions
        • DeleteGlobalVariable
        • DeleteUserVariable
        • Dismiss
        • Display
        • DMXAddress
        • DMXLayer
        • DMXReadout
        • DMXUniverse
        • DoubleSpeed
        • Down
        • DumpLog
        • Drive
        • DropOwnership
        • Echo
        • Edit
        • EditSetting
        • Eject
        • Effect
        • EncoderPage
        • EndIf
        • Environment
        • Exchange
        • Executor
        • Export
        • Extract
        • Extension
        • Fade
        • FaderCrossFade
        • FaderCrossFadeA
        • FaderCrossFadeB
        • FaderMaster
        • FaderRate
        • FaderSpeed
        • FaderTemp
        • FaderTime
        • FeatureGroup
        • Filter
        • Fix
        • FixtureClass
        • FixtureLayer
        • Fixture
        • FixtureType
        • Flip
        • Flash
        • Fog
        • Freeze
        • Full
        • Gel
        • GetGlobalVariable
        • GetUserVariable
        • Go+
        • Go-
        • Goto
        • Grid
        • GridPosition
        • Group
        • HalfSpeed
        • Help
        • HelpLua
        • Hex8
        • Hex16
        • Hex24
        • Highlight
        • Houselights
        • Hz
        • If
        • IfActive
        • IfOutput
        • IfProgrammer
        • Image
        • Import
        • Index
        • Insert
        • Integrate
        • Interface
        • Invert
        • Invite
        • IP
        • JoinSession
        • Key
        • Keyboard
        • KeyboardShortcut
        • Kill
        • KnockIn
        • KnockOut
        • Label
        • Layout
        • LearnSpeed
        • LeaveSession
        • Library
        • List
        • ListOwnership
        • ListReference
        • Load
        • Loaded
        • LoadShow
        • Lock
        • LogIn
        • LogOut
        • Lowlight
        • Lua
        • LuaFile
        • Macro
        • MArker
        • Master
        • MAtricks
        • Measure
        • Media
        • MemoryInfo
        • Menu
        • Mesh
        • Move
        • Multipatch
        • MyRunningMacro
        • MyRunningPreset
        • MyRunningSequence
        • MyRunningTimer
        • Natural
        • NDI
        • NewShow
        • Next
        • NextY
        • NextZ
        • NetworkNode
        • NonDim
        • Normal
        • Note
        • Off
        • Offset
        • On
        • onPC
        • OSC
        • Oops
        • OutputLayer
        • Page
        • Part
        • Park
        • Paste
        • Patch
        • Pause
        • Percent
        • PercentFine
        • Phase
        • Physical
        • Plugin
        • Preset
        • PresetUpdate
        • Press
        • Preview
        • Previous
        • PreviousY
        • PreviousZ
        • Programmer
        • Property
        • ProcessingUnit
        • Pyro
        • Quickey
        • Rate1
        • RDM
        • Readout
        • Reboot
        • Recast
        • Record
        • Relative
        • Release
        • ReloadAllPlugins
        • ReloadUI
        • Remote
        • RemoteHID
        • RemoteCommand
        • Remove
        • RenderQuality
        • Reset
        • Restart
        • Root
        • RealtimeChannel
        • RunningMacro
        • RunningPreset
        • RunningSequence
        • RunningTimecode
        • RunningTimer
        • SaveShow
        • ScreenConfiguration
        • ScreenContent
        • Scribble
        • Seconds
        • Select
        • Selection
        • SelectFixtures
        • Sequence
        • SendMIDI
        • SendOSC
        • Set
        • SetGlobalVariable
        • SetUserVariable
        • Shuffle
        • ShutDown
        • SnapDelay
        • SoftwareImport
        • SoftwareUpdate
        • SoundChannel
        • Solo
        • SpecialExecutor
        • Speed
        • Speed1
        • SpeedMaster
        • Stage
        • Station
        • StationSettings
        • Step
        • Stomp
        • Store
        • SwitchTograndMA2Software
        • SwitchTograndMA3Software
        • Swap
        • Temp
        • Thru
        • Time
        • Timecode
        • TimecodeSlot
        • Timer
        • Toggle
        • TopUp
        • Top
        • Transition
        • Type
        • UIChannel
        • UIGridSelection
        • Unblock
        • Universal
        • Unlock
        • Unpark
        • Unpress
        • Up
        • Update
        • UpdateContent
        • User1
        • User2
        • User
        • UserProfile
        • Video
        • Version
        • View
        • ViewButton
        • Width
        • World
        • Zero
      • Option keywords
        • /Active
        • /ActiveForSelected
        • /AddNewContent
        • /All
        • /AllForSelected
        • /Ask
        • /Auto
        • /CopyCueDestination
        • /CopyCueSource
        • /CreateReferenceObject
        • /CreateSecondCue
        • /CueOnly
        • /Date
        • /Default
        • /DiscardChanges
        • /DMX
        • /DMXProtocols
        • /Embed
        • /Enumerate
        • /File
        • /ForceGlobal
        • /GDTF
        • /Gaps
        • /Global
        • /GridMergeMode
        • /Indirect
        • /InputFilter
        • /KeepActivation
        • /LocalSettings
        • /Look
        • /MAtricks
        • /Merge
        • /MergeHighPriority
        • /MergeLowPriority
        • /MoveValues
        • /NoAutoClose
        • /NoConfirmation
        • /NoDependencies
        • /NoOops
        • /NoRefresh
        • /NoSave
        • /NoShowData
        • /NoSubfolders
        • /OriginalContentOnly
        • /Output
        • /OutputStations
        • /Overwrite
        • /PatchOffset
        • /Path
        • /PhaserData
        • /Programmer
        • /Release
        • /Remove
        • /Save
        • /Screen
        • /Selection
        • /Selective
        • /Single
        • /Tab
        • /Type
        • /Universal
        • /Wrap
      • Extended command line syntax options
    • Windows, Views, and Menus
      • Add window
      • Rearrange
      • Store and recall views
      • Remove windows from a screen
      • Window settings
      • Title bar configuration
      • Menus
      • Change menu locations
      • Pool windows
        • Create pool objects
        • Label pool objects
        • Move pool objects
        • Insert pool objects
        • Copy pool objects
        • Lock and unlock pool objects
        • Delete pool objects
    • Networking
      • Interfaces and IP
      • Session
        • Create a session
        • Join a session
        • Leave a session
        • Invite to a session
        • Dismiss from session
        • Create a custom key
        • Session master selection
      • Web remote
      • Network design
        • Protocol details
        • WLAN (WiFi)
      • Regulations and standards
    • DMX In and Out
      • DMX port configuration
      • Ethernet DMX
        • Art-Net menu
        • sACN menu
        • Transmit DMX using Art-Net
    • Single User and Multi User Systems
      • Create user
      • User settings
      • Object ownership
    • Patch and Fixture Setup
      • What are fixtures
      • Add fixtures to the show
      • Add multipatch fixtures
      • MVR
      • Live patch
      • DMX sheet
      • DMX universes
      • Remove fixtures from the show
      • Position fixtures in the 3D space
      • 3D viewer
      • Render quality
      • Camera pool
      • Stages
      • Classes and layers
      • Attribute definitions
        • Activation group
        • Feature group
        • Deactivation group
      • Parameter list
      • DMX curves
    • Operate Fixtures
      • Select fixtures
      • What is the programmer
      • Fixture sheet
        • Graphics
      • Encoder resolution
      • Using the color picker
      • Gel pool
      • Selection bar
      • Align
      • Selection Grid
      • SMArt view
    • Scribbles
      • Create scribbles
      • Edit scribbles
      • Assign scribbles
      • Delete scribbles
    • Images
      • Screenshots
    • Video
    • Meshes
    • Gobos
    • Symbols
      • Import symbols
      • Delete symbols
    • Appearances
      • Create appearances
      • Use appearances
      • Delete appearances
    • Notes
    • Groups
      • Create groups
      • Edit groups
      • Delete groups
      • Group masters
    • Presets
      • Preset pools
      • Create new presets
      • Recipe presets
      • Use preset
      • Edit or Update presets
    • Worlds and Filters
      • At filter
      • Create a world
      • Create a filter
      • Use a world or filter
      • Delete a world
      • Delete a filter
    • MAtricks and Shuffle
      • Blocks
      • Groups
      • Wings
      • Widths
      • Shuffle
      • Transform
    • Cues and Sequences
      • What is tracking
        • Tracking distance
        • Break
      • Sequence sheet
      • Content sheet
      • Sequence settings
      • Store cues
      • Update cues
      • Copy cues
      • Cue recipes
      • Store settings and preferences
      • Play back cues
      • Move in black
      • Cue timing
      • Renumber cues
      • Delete cues
    • Executors
      • Assign object to an executor
      • Executor configurations
      • Running playbacks
      • Special executors
    • Masters
      • Selected masters
      • Grand masters
        • Time control
      • Speed masters
      • Playback masters
    • Recipes
    • Phasers
      • Phaser editor
      • Create sinus dimmer phaser
      • Create circle phaser
      • Create circle phaser around position
      • Create color rainbow phaser
    • XYZ
      • Activating XYZ for fixture types
      • MArker fixture
    • Macros
      • Create macros
      • Import macros
      • Edit macros
      • Assign macros to keys and buttons
      • Variables
      • Examples
    • Agenda
      • View modes
      • Create an agenda entry
      • Edit an agenda entry
      • Agenda toolbar
    • Timers
      • Stopwatch
      • Countdown
    • Timecode
      • What are timecode slots
      • Timecode settings
      • Track groups
      • Time ranges and events
      • Toggle view mode
      • Record a timecode show
      • Record an external timecode show
      • Edit a timecode show
      • External sources
    • Layouts
      • Create a layout
      • Assign multipatch fixtures
      • Edit layout
      • Layout view settings
      • Edit layout view
      • Edit layout elements
      • Layout encoder bar
    • Plugins
      • What is Lua?
      • Handle
      • Interface functions
        • Progress bar
      • Variable functions
      • Functions - Object-Free API
        • AddonVars
        • BuildDetails
        • ClassExists
        • CloseAllOverlays
        • CloseUndo
        • Cmd
        • CmdIndirect
        • CmdIndirectWait
        • CmdObj
        • ConfigTable
        • Confirm
        • CreateUndo
        • CurrentEnvironment
        • CurrentExecPage
        • CurrentProfile
        • CurrentUser
        • DataPool
        • DefaultDisplayPositions
        • DelVar
        • DeskLocked
        • DeviceConfiguration
        • DrawPointer
        • Echo
        • ErrEcho
        • ErrPrintf
        • Export
        • ExportCSV
        • ExportJson
        • FromAddr
        • GetApiDescriptor
        • GetAttributeByUIChannel
        • GetAttributeCount
        • GetAttributeIndex
        • GetChannelFunction
        • GetChannelFunctionIndex
        • GetClassDerivationLevel
        • GetDisplayByIndex
        • GetDisplayCollect
        • GetDMXUniverse
        • GetDMXValue
        • GetExecutor
        • GetFocus
        • GetFocusDisplay
        • GetObjApiDescriptor
        • GetPath
        • GetPathSeparator
        • GetRTChannel
        • GetRTChannelCount
        • GetRTChannels
        • GetSample
        • GetSelectedAttribute
        • GetShowFileStatus
        • GetSubfixture
        • GetSubfixtureCount
        • GetTokenName
        • GetTokenNameByIndex
        • GetUIChannelCount
        • GetUIChannelIndex
        • GetUIChannels
        • GetVar
        • GlobalVars
        • HandleToInt
        • HandleToStr
        • HookObjectChange
        • HostOS
        • HostSubType
        • HostType
        • Import
        • IncProgress
        • IntToHandle
        • IsObjectValid
        • KeyboardObj
        • MasterPool
        • MessageBox
        • MouseObj
        • ObjectList
        • Patch
        • PopupInput
        • Printf
        • ProgrammerPart
        • Pult
        • ReleaseType
        • Root
        • SelectedSequence
        • Selection
        • SelectionCount
        • SelectionFirst
        • SelectionNext
        • SerialNumber
        • SetBlockInput
        • SetLED
        • SetProgress
        • SetProgressRange
        • SetProgressText
        • SetVar
        • ShowData
        • ShowSettings
        • StartProgress
        • StopProgress
        • StrToHandle
        • TextInput
        • Time
        • Timer
        • TouchObj
        • UserVars
        • Version
      • Functions - Object API
        • Addr
        • AddrNative
        • Children
        • Dump
        • Export
        • HasActivePlayback
        • Import
        • ToAddr
    • Quickeys
      • Quickey editor
      • Use quickey pool objects
      • Example
    • Data Pools
    • System
      • Date and time
      • Clock
      • Desk lights
      • System information
      • System monitor
      • Info window
    • Sound
    • Remote In and Out
      • DC remotes
      • MIDI remotes
      • DMX remotes
      • OSC
        • Examples
        • TouchOSC
        • QLab
        • Open stage control
        • zactrack
        • Protocol viewer
      • PSN
      • MIDI
    • RDM
    • Control other MA Devices
      • grandMA3 nodes
      • MA network switch
      • RemoteHID
    • Update the Software
      • Update grandMA3 consoles
      • Update grandMA3 Nodes
      • Update grandMA3 onPC windows hardware
      • Update grandMA3 viz-key
      • Network update
      • Delete update files
      • Troubleshooting
    • Fixture Types
      • Import fixture types
        • Import GDTF
        • Conflicts in fixture types
      • Build fixture types
        • Insert fixture types
        • Insert DMXModes
        • Insert geometries
        • Insert models
        • Link models to geometries
        • Link DMX modes to geometries
        • Environmental fixture types
      • Export fixture types
    • File Management
      • SFTP connection
      • Import / Export menu
      • Folder structure
    • Shut Down the System
    • Troubleshooting
      • Clean start
      • Update does not work
      • Station does not connect
      • Panic macro
    • Glossary
  • grandMA3 Quick Start Guide
  • grandMA3 Quick Manual consoles
  • grandMA3 Quick Manual processing units
  • grandMA3 Quick Manual Nodes
  • grandMA3 Quick Manual Nodes DIN-Rail
  • grandMA3 Quick Manual onPC command wing XT
  • grandMA3 Quick Manual onPC command wing
  • grandMA3 Quick Manual onPC fader wing
  • grandMA3 Quick Manual onPC rack-unit
  • grandMA3 Quick Manual viz-key
  • grandMA3 Quick Manual I/O Nodes
  • Release Notes
Select different version
 
Hint:
New help version
The help version you selected belongs to an older software version. You may want to view the latest help version.
Version 1.9

MessageBox(table)

Description

The MessageBox Lua function is used to create pop-up message boxes. These can be simple or complex information pop-ups with many different options and user inputs.

The message box contains multiple elements that must be defined in a table. This table is the single input argument to the function.

The elements in the message box are displayed in alphabetical order.

This function is part of the User Interface functions.

Arguments

  • Table:
    The input to the function must be formatted as a table using key-value pairs. The needed elements have default values that will be used if not overwritten. The values can be defined in any order if the key is defined.
    The table can have the following elements:
    • title:
      This is the title of the pop-up message box.
    • titleTextColor:
      This is the text color for the title text. The value is a number or string that refers to the UI Colors in the color theme. See the link below.
    • backColor:
      This is the color of the frame or border of the pop-up. The value is a number or string that refers to the UI Colors in the color theme. See the link below.
    • icon:
      This is an icon that can be shown in the upper left corner of the pop-up. The value can be an integer or a string that refers to the number or name of a texture image (without the file format).
      The icons can be listed by navigating to the texture folder ChangeDestination GraphicsRoot/TextureCollect/Textures and then doing a List command.
      This shows a long list with numbers and names of all the textures in the Command Line History window.
    • message:
      This message text string is displayed in the main part of the pop-up. A new line can be created by adding a "\n" in the text.
    • messageTextColor:
      This is the text color for the message text. The value is a number or string that refers to the UI Colors in the color theme. See the link below.
    • timeout:
      The timeout value is an integer that indicates how long the message box is displayed in milliseconds. It will show a countdown timer at the top of the message area. When the countdown runs out, it will close the pop-up.
      When the timeout closes the pop-up, it returns a success element with a true value (see more about the return below). It was closed "normally".
    • timeoutResultCancel:
      This element can change the return to mimic a cancel of the pop-up, which returns a false instead of a true for the success element.
    • timeoutResultID:
      When the timeout closes the pop-up with the success value = true, a special return result can be defined using this, for instance, setting the value to 99 - then 99 is returned when the message box is closed by the timeout.
    • commands:
      The commands are buttons at the bottom of the message box pop-up. The input here is a table of objects using the following structure:
      • value:
        This integer value will be returned as the result value - see more about the return below.
      • name:
        This is a string which will be shown on the button.
    • inputs:
      The inputs are user input fields where text or numbers can be input. The input fields will be displayed in alphabetical order.
      The input fields are defined using an table with the following structure (see example 5 below):
      • name:
        This is a string value - the text will be shown as a label for the input field.
      • value:
        This is a string value - it is a default input value for the input field.
      • blackfilter:
        This is a string value - it defines input characters that are not allowed.
      • whitefilter:
        This is a string value - it defines which input characters are allowed.
      • vkPlugin:
        This is a string value - it is the name of the input pop-up, which is opened if the on-screen keyboard icon () is tapped in the pop-up. Example 5 below has a list of possible vkPlugin values.
      • maxTextLength:
        This is an integer value - it defines the maximum number of characters for the input.
    • states:
      The states are buttons in the pop-up. State buttons have a small checkbox and can have a true or false state. The buttons will be displayed in alphabetical order.
      The buttons are defined using a table with the following structure (see example 4 below):
      • name:
        This is a string value - the text will be shown on the button.
      • state:
        This is the initial state of the button checkbox.
    • selectors:
      Selector buttons are two different types of buttons. Each type can have a selected value based on a list of available values. The two types are Swipe button (type 0) and Radio button (type 1).
      The buttons are defined in a table with the following structure:
      • name:
        This is a string value - the text will be shown on the button (swipe button) or as a label above the buttons (radio buttons).
      • selectedValue:
        This is an integer value - it defines the default selected value
      • type:
        This is an integer value - it defines the type of selector button. The options are:
        • 0:
          This defines the button as a swipe button.
        • 1:
          This defines the button as a radio button.
      • values:
        This is another table containing the different values available for the selector button. Each value element in the table has the following structure: ["string"]=integer
        The string is the name displayed for the value. The integer is the value returned and the one used for selectedValue (see above). See example 6 below for an example of use.

The table can contain some or all of the elements described above.

The colors mentioned above can be a string or number value. It refers to a defined UI Color in the color theme, for instance, "Global.Text" or 1.27. See more in the Color Theme topic.

A message box pop-up should have at least a title, message, and either a timeout or some basic command buttons. See the first three examples below.

Return

  • Table:
    The return from a message box pop-up is formatted in a table. The returned table adjusts to match the elements of the message box. For instance, if there are selection buttons in the message box, then there is another table inside the result table containing the return from the selection buttons. See the examples for details on how to retrieve the results. The table can contain the following elements:
    • success:
      This is a boolean - it returns true if the message box was closed by tapping a command button or by a timeout (see timeoutResultCancel above for exceptions).
    • result:
      This is an integer - it returns the value of the tapped command button or the timeout result ID.
    • inputs (only if the message box has inputs fields):
      This is a table with a list of the input fields' name and string value in a key-value pair table.
    • states (only if the message box has state buttons):
      This is a table with a list of the state buttons' name and boolean value in a key-value pair table.
    • selectors (only if the message box has selector buttons):
      This is a table with a list of the selector buttons' name and integer value in a key-value pair table.

An error is thrown if the message box does not have inputs, states, and selectors, but the script tries to use the table elements.

See the examples to see how to extract the results.

Examples

There are six different examples demonstrating different elements of the message box. The elements can be combined, but the examples highlight different functions.

Example 1

A simple message box pop-up that shows a single confirm button:

return function ()
    -- This creates a small pop-up with a single button.
    local returnTable = MessageBox(
        {
            title = "Please confirm This",
            commands = {{value = 1, name = "Confirm"}}
        }
    )

    -- Print the content of the returned table.
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)
end

Example 2

This example opens a pop-up with some text and two command buttons:

return function ()
    -- A table with two default buttons for the pop-up
    local defaultCommandButtons = {
        {value = 2, name = "OK"},
        {value = 1, name = "Cancel"}
    }

    -- A table with the elements needed for the pop-up
    local messageTable = {
        icon = "object_smart",
        backColor = "Window.Plugins",
        title = "This is the title",
        message = "This is a message\nThat can have multiple lines",
        commands = defaultCommandButtons,
    }

    -- The creation on the actual pop-up with the result stored in a variable
    local returnTable = MessageBox(messageTable)

    -- Print the content of the returned table
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)
end

Example 3

This example displays a message box for 3 seconds and then closes itself:

return function ()
    -- This variable contains the table used as argument for the messagebox
    local messageTable = {
        title = "Do not worry",
        message = "This message will self destruct - Goodbye!",
        timeout = 3000,
        timeoutResultCancel = false,
        timeoutResultID = 99,
    }

    -- This creates the messagebox pop-up and store the return table in a variable
    local returnTable = MessageBox(messageTable)

    -- Print the content of the returned table
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)
end

Example 4

This example adds state buttons to the message box. The buttons are added to a table for a better overview.

return function ()
    -- A table with two default buttons for the pop-up
    local defaultCommandButtons = {
        {value = 2, name = "OK"},
        {value = 1, name = "Cancel"}
    }
    -- A table with three state buttons
    -- The buttons will be displayed alphabetically in the pop-up
    local stateButtons = {
        {name = "State B", state = false},
        {name = "State A", state = false},
        {name = "New State", state = false}
    }

    -- A table with the elements needed for the pop-up
    local messageTable = {
        icon = "object_smart",
        backColor = "Window.Plugins",
        title = "This is state buttons",
        message = 'Toggle the states and click "Ok"',
        commands = defaultCommandButtons,
        states = stateButtons,
    }

    -- The creation on the actual pop-up with the result stored in a variable
    local returnTable = MessageBox(messageTable)

    -- Print the content of the returned table
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)
    -- Print a list with the state of the stateButtons
    for name,state in pairs(returnTable.states) do
        Printf("State '%s' = '%s'",name,tostring(state))
    end
end

Example 5

This example shows the input fields.

return function ()
    -- A table with two default buttons for the pop-up
    local defaultCommandButtons = {
        {value = 2, name = "OK"},
        {value = 1, name = "Cancel"}
    }
    -- A table with three input fields
    -- The fields will be displayed alphabetically in the pop-up based on name
    local inputFields = {
        {name = "Numbers Only", value = "1234", whiteFilter = "0123456789", vkPlugin = "NumericInput"},
        {name = "Text Only", value = "abcdef", blackFilter = "0123456789"},
        {name = "Maximum 10 characters", value = "", maxTextLength = 10}
    }
    -- Possible vkPlugin values:
    -- - "TextInput" : same as default - standard on-screen keyboard
    -- - "TextInputNumOnly" : text input but only with number buttons
    -- - "TextInputNumOnlyRange" : text input but only with number and related range buttons
    -- - "TextInputTimeOnly" : text input styled for time input - includes buttons for time values
    -- - "NumericInput" : general number input
    -- - "CueNumberInput" : number input styled for cue number
    -- - "RelCueNumberInput" : number input with the relative "delta" button
    -- - "IP4Prefix" : designed for inputting an IPv4 address allowing CIDR notation

    -- A table with the elements needed for the pop-up
    local messageTable = {
        icon = "object_smart",
        backColor = "Window.Plugins",
        title = "This is input fields",
        message = 'Change the values in the input fields and click "Ok"',
        commands = defaultCommandButtons,
        inputs = inputFields,
    }

    -- The creation on the actual pop-up with the result stored in a variable
    local returnTable = MessageBox(messageTable)

    -- Print the content of the returned table
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)
    -- Print a list with the values of the input fields
    for name,value in pairs(returnTable.inputs) do
        Printf("Input '%s' = '%s'",name,tostring(value))
    end
end

Example 6

This example shows the different selector buttons.

return function ()
    -- A table with two default buttons for the pop-up
    local defaultCommandButtons = {
        {value = 2, name = "OK"},
        {value = 1, name = "Cancel"}
    }
    -- A table with selector buttons
    -- The buttons will be displayed alphabetically in the pop-up based on name
    local selectorButtons = {
        { name="Swipe Selector", selectedValue=1, type=0, values={["Swipe1"]=1,["Swipe2"]=2}},
        { name="Radio Selector", selectedValue=2, type=1, values={["Radio1"]=1,["Radio2"]=2}},
        { name="Another Radio", selectedValue=3, type=1, values={["Radio3"]=3,["Radio4"]=4}}
    }

    -- State button to show grouping with swipe Selector button
    local stateButton = {
        {name = "State Button", state = false},
    }
    -- A table with the elements needed for the pop-up
    local messageTable = {
        icon = "object_smart",
        backColor = "Window.Plugins",
        title = "This is input fields",
        message = 'Change the values in the input fields and click "Ok"',
        commands = defaultCommandButtons,
        states = stateButton,
        selectors = selectorButtons,
    }

    -- The creation on the actual pop-up with the result stored in a variable
    local returnTable = MessageBox(messageTable)

    -- Print the content of the returned table
    Printf("Success = "..tostring(returnTable.success))
    Printf("Result = "..returnTable.result)

    -- Print a list with the values of the selection buttons
    for name,value in pairs(returnTable.selectors) do
        Printf("Input '%s' = '%s'",name,tostring(value))
    end

    -- Print a list with the state of the stateButton
    for name,state in pairs(returnTable.states) do
        Printf("State '%s' = '%s'",name,tostring(state))
    end
end

Select different version