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

Re: Help with validating a date input to a dialog


  • Subject: Re: Help with validating a date input to a dialog
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 30 Mar 2001 17:29:21 -0800

On 3/30/01 4:54 PM, "Michelle Steiner" <email@hidden> wrote:

> 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


You forgot to escape the internal quotation marks in strings (both places).
I can't even get it to compile without them, so I don't know how you're
getting that error. Is there something slightly different in the way you
have it in Script Editor. This works fine:


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
--
Paul Berkowitz


References: 
 >Help with validating a date input to a dialog (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Help with validating a date input to a dialog
  • Next by Date: Re: Script editor/Finder weirdness
  • Previous by thread: Re: Help with validating a date input to a dialog
  • Next by thread: Re: Help with validating a date input to a dialog
  • Index(es):
    • Date
    • Thread