> On Apr 15, 2015, at 10:11 AM, Michael <[email protected]> wrote:
>
> Is there a shell command to display a dialog box and return which selection
> was made?
>
> I'm thinking of a main text string, and 1 to 3 choice boxes (like "Save",
> "Cancel", "Discard"), that returns a value corresponding to which box was
> selected.
You can use Applescript, either by making your whole script in AppleScript or
by using `osascript` like this:
osascript -e 'display dialog "Do you have a question?" buttons {"Yes", "No",
"Maybe"} default button "Yes"'
There are a lot more things you can do with this:
https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html#//apple_ref/doc/uid/TP40000983-CH216-SW12
—
Karl Kuehn
[email protected]
_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk