ui.confirm (msg , [title] )
Displays a confirmation message dialog box with a question-mark icon, and waits for the user to click the Yes, No or Cancel button.
A string that indicates the message to display to the user.
An optional string that indicates the title of the message dialog box (defaulting to "Confirmation"
This function returns the string:
- "yes" once the user has pressed the Yes button.
- "no" once the user has pressed the No button.
- "cancel" once the user has pressed the Cancel button or after having closed the dialog.
local ui = require "ui"
-- create a new Pipe to capture output of the "WMIC PATH Win32_Battery Get EstimatedChargeRemaining" command
if ui.confirm("Do you want to hear a sound ?") == "yes" then