Is there any way to avoid having to press the return or enter key to accept the input text from a dialog such as this one? In other words, if the operator typed the number 5 in the dialog box, the dialog box would immediately act as if “OK” was triggered, and then allow the 5 to be passed to a variable and used later in the script?
Thanks,
Jeff
set userInput to display dialog "Enter a number from 1-9" buttons {"Cancel", "OK"} default button 2 default answer "1"
set theNumber to text returned of userInput