• 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
Help with validating a date input to a dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with validating a date input to a dialog


  • Subject: Help with validating a date input to a dialog
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 30 Mar 2001 16:54:54 -0800

Here's the script:

display dialog (my setthedate("Please enter the date in format
"mm/dd/yyyy"."))

on setthedate(prompt)
set DateToSend to (text returned of (display dialog prompt default
answer ""))
try
date DateToSend
on error
my setthedate("Please us the correct format "mm/dd/yyyy"")
end try
return DateToSend
end setthedate

Here is the log:

tell current application
display dialog "Please enter the date in format "mm/dd/yyyy"." default
answer ""
--> {text returned:"aaa", button returned:"OK"}
display dialog "Please us the correct format "mm/dd/yyyy"" default
answer ""
--> {text returned:"01/01/2001", button returned:"OK"}
display dialog "aaa"
--> {button returned:"OK"}
end tell

Why is "aaa" being returned instead of "01/01/2001"?

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------


  • Follow-Ups:
    • Re: Help with validating a date input to a dialog
      • From: Paul Berkowitz <email@hidden>
    • Re: Help with validating a date input to a dialog
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Script editor/Finder weirdness
  • Next by Date: Re: Script editor/Finder weirdness
  • Previous by thread: Re: Script editor/Finder weirdness
  • Next by thread: Re: Help with validating a date input to a dialog
  • Index(es):
    • Date
    • Thread