0

For Linux, there is a command xmessage which displays a message in a window. Does anyone know what is the equivalent one on macOS?

  • what computer do you have and what system are you running? – jmh Jul 24 '20 at 5:00
3

AppleScript

On macOS, displaying simple dialogs is possible with AppleScript:

/usr/bin/osascript -e "display dialog \"Hello world\""

See Displaying Dialogs and Alerts in Apple's Mac Automation Scripting Guide.

Additional buttons, choices, and other limited interface elements can be added:

set theDialogText to "An error has occurred. Would you like to continue?"
display dialog theDialogText buttons {"Don't Continue", "Continue"} default button "Continue" cancel button "Don't Continue"

AppleScript dialog box

-1

There is an xmessage command on the Mac which does the same thing. The options may be different but there is a man page for xmessage.

  • 3
    That only works if you have XQuartz (X Windows for macOS) installed; most people don't. – Gordon Davisson Jul 24 '20 at 5:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .