TransWikia.com

What is the 'xmessage' command equivalent on macOS?

Ask Different Asked on December 21, 2021

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

2 Answers

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.

Answered by Natsfan on December 21, 2021

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

Answered by Graham Miln on December 21, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP