Re: Making sure the input field returns integer
Re: Making sure the input field returns integer
- Subject: Re: Making sure the input field returns integer
- From: Andrew Oliver <email@hidden>
- Date: Mon, 17 Mar 2003 12:23:10 -0800
There's no direct method to do this. You have to parse the result and
redisplay the dialog if it doesn't meet your needs:
set gotNum to false
repeat until gotNum
display dialog "Enter a number" default answer "0"
set inputVal to text returned of result
try
set inputVal to inputVal as integer
-- if we get here, AppleScript can coerce the string to a integer,
so we're OK
set gotNum to true
end try
end repeat
On 3/17/03 11:44 AM, "Guillaume Iacino" <email@hidden> wrote:
>
Hi,
>
>
Does someone has an example of an input field that only accepts integer (no
>
string or decimal number).
>
>
display dialog "Please enter number" default button "OK"
>
set NumberResult to (text returned of result)
>
>
Thank you in advance for your help.
>
>
Guillaume
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.