easymacro/docs/en/docs/tools/messages.md

1.4 KiB

Message Box

msgbox

Show standard message.

    message = 'Fucking World'
    title = 'My Macro'
    app.msgbox(message, title)

msgbox


warning

Show message with warning icon.

    message = 'Caution, this action is dangerous'
    title = 'My Macro'
    app.warning(message, title)

warning


errorbox

Show message with error icon.

    message = 'ERROR: contact support'
    title = 'My Macro'
    app.errorbox(message, title)

error


question

Ask a question by showing the interrogation icon and displaying the command buttons Yes and No. The answer is always True if user select yes and False otherwise.

    message = 'Python is easy?'
    title = 'My Macro'
    result = app.question(message, title)
    app.msgbox(result)

question


inputbox

Shows a message to user, allowing to capture an answer.

    message = 'Capture your name'
    name = app.inputbox(message)
    app.msgbox(name)

inputbox

To hide on screen what the user typing, util for request passwords.

    message = 'Type your password'
    echochar = '*'
    password = app.inputbox(message, echochar=echochar)
    app.msgbox(password)

inputbox