When I first started I wanted a dialog box that popped up saying “Hello World!”. Now I want a simple dialog box to pop up but ask for input. This is actually quite simple. All you have to do is add “Default Answer “”‘ to the display dialog statement.
display dialog “How are you?” Default Answer “Ok…” default answer “”
Here is a simple “What day is it?” dialog example.


The returned result for this example is: {text returned:”Monday”, button returned:”OK”}. Alternatively, you can set the text entered into the dialog box directly to a variable by using the statement below:
set textReturned to the text returned of (display dialog "what day is it?" default answer "Monday")
0 Responses to “Let’s have a simple Dialog”