Problem validating numbers

Here’s the code I’m working with:

on validateNumber()
	set isvalid to ""
	if the contents of text field "mynum" of tab view item "tester" of tab view "tabs" of window "Test" is less than "1001" as integer then
		set isvalid to (isvalid & "Can't use a number below 1001" & return)
	end if

The problem arises that if the number is 1000, then the validity test works

However, if the number is 999 or less, the validity test fails

I can’t figure it out :frowning:

try this

on validateNumber()
   set isvalid to ""
   if (contents of text field "mynum" of tab view item "tester" of tab view "tabs" of window "Test") as number is less than 1001 then
       set isvalid to (isvalid & "Can't use a number below 1001" & return)
   end if

That worked, I can’t believe I was that close and couldn’t figure it out! Thanks so very much!