Alert boxes, part I

If you type

 alert hello

at a Terminal prompt, you’ll get a dialog box with a Cancel button. If you start adding words, as in

alert hello there you

you’ll get a box with several buttons. Phrases should be enclosed in quotes, as in

 alert "Hello there" "What the heck" "is this?"

When you select a button, your selection is returned to the command line as stdout.
What use could this possibly be? See the tip Bootup Fortune for one example, or Alert boxes, part II for another.
This is a great way to introduce an element of interactivity into your bash shell scripts.

 

Comments

No comments so far.

(comments are closed)

Kategorien

 
 
Blogroll
Resources