i know you can prompt but how

whats the code snippet for creating a prompt dialog box asking the user:

“How many times would you like to loop:”

and getting the input and saving that to a property variable.

Also i need 2 of these, am i right to assume that one code does all prompts?? both questions are the same as above and both are strings.

Cheers guys.

This might work.

set promptText to "How many times would you like to loop?"
set dd1 to (display dialog promptText default answer 0)
set dd2 to (display dialog promptText default answer 0)
set loops1 to text returned of dd1
set loops2 to text returned of dd2

– Rob