I'm building an Apple Script to prompt and receive input from a user via a dialog box. The default answer of the dialog is "Enter Code". The required input is a 6-digit code given to each user. On receiving the user's input (or code), some validation checks need to occur confirming that the user's input is acceptable based on the following conditions:
User can't enter letters or symbols.
Input must be in an integer (whole numbers only, and yes zero counts).
The code (input), just be exactly (or equal to) 6 digits long. No more or no less than 6.
Background - the user's code is generated ad-hoc from another application and is unique each time. There is no way to cross reference this code.
For example, the user enters 123456 into the dialog box. Using Apple Script, how can I script this, ensuring again, that the code is all numbers, and precisely 6 digits long?