• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Validate user input
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Validate user input


  • Subject: Re: Validate user input
  • From: "Marc K. Myers" <email@hidden>
  • Date: Tue, 06 Nov 2001 13:51:50 -0500
  • Organization: [very little]

> Date: Tue, 6 Nov 2001 10:43:05 -0600
> To: email@hidden
> From: Preston Smith <email@hidden>
> Subject: Validate user input
>
> How do I confirm that a user has entered only numerals, or certain
> punctuation marks, into a dialog box?

property validChars : "1234567890-() "

set theText to text returned of [optn-L]
(display dialog "Enter some text:" default answer "")
repeat with i from 1 to (length of theText)
if character i of theText is not in validChars then
display dialog "\"" & (character i of theText) & [optn-L]
"\" is not a valid character"
exit repeat
end if
end repeat

Note the "[optn-L]" stands in for the AppleScript continuation character.

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[11/6/01 1:50:32 PM]


  • Prev by Date: Quark guide placement scripting
  • Next by Date: Re: tell syntax - specifying the APPL with a preset string
  • Previous by thread: Re: Validate user input
  • Next by thread: Re: Validate user input
  • Index(es):
    • Date
    • Thread