Skip to content
Bart Reardon edited this page Aug 16, 2024 · 27 revisions

Getting Started with swiftDialog

dialog -s --title "Welcome to swiftDialog" --message "Hi There. <br>It's really nice to see you 🙂"

image

swiftDialog's purpose is intended as a helper utility for macadmins to use via script to display a dialog to present information to a user and report the action the user took which can be later used for more script processing or simply used to display some piece of information.

swiftDialog accepts input from the command line with one or more command line options to tell swiftDialog what to display and how to display it.

There are a number of options available that can be used to customise what you want to show that can range from the very simplistic informational display to more complex processing with text entry, dropdown list, image display and more.

Running swiftDialog

The .pkg installer from the releases page will install swiftDialog to /usr/local/bin/dialog which should also be in the default $PATH on macOS

To call dialog from your script, you can use the full path or rely on $PATH

$ dialog --title ...

or

$ /usr/local/bin/dialog --title ...

At the most basic level, dialog can simply use the --title and --message command line options to present a dialog with the desired message.

swiftDialog can perform much more than that though and you should read the Command Line Options page for a full list of options available or call dialog with the --help option.

Requirements:

macOS

swiftDialog is a universal binary app written using SwiftUI. From version 2.3, swiftDialog requires macOS 12.

The last version that supports macOS 11 is v2.2.1.

Read more about:

Customising swiftDialog's Title

Customising swiftDialog's Message Display

Customising the image displayed in swiftDialog's Icon area

Adding a Banner Image

Customising the Buttons and Button Behaviour

Additional Features

Support

swiftDialog was started in part as a learning exercise in how to write applications using SwiftUI and partly to satisfy a need for a way to communicate information to mac users in a style that I liked.

Support can be offered by creating an issue. Feature requests are also welcome.

Contact

You can reach the author over at the Macadmins slack in the #swiftdialog channel (username @bartreardon - usually hanging out in #anzmac) however please limit any support queries or general questions to github, at the very least so your problem can be tracked and addressed. Thank you 😃

Clone this wiki locally