• 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: date works with literal, but not otherwise
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: date works with literal, but not otherwise


  • Subject: Re: date works with literal, but not otherwise
  • From: Jim Marsh <email@hidden>
  • Date: Thu, 17 Dec 2009 13:42:58 -0400

Hi Bernhard,

The reason for the error seems to be that you are returning a date object in your   "set myDate1 to date dateString"  but it appears you want a string.

I tried this and it worked.:)

set dateString to "Montag, 7. Dezember 2009 00:00:00"
set myDate1 to dateString
try
display dialog "myDate1: " & myDate1 as string
on error errText number errNum
display dialog errText & " " & errNum
end try

Regards,
Jim
--------------------------------
Hi List

In AppleScriptEditor, the following code displays the correct date

set dateString to "Montag, 7. Dezember 2009 00:00:00"
set myDate1 to date dateString
try
display dialog "myDate1: " & myDate1 as string
on error
display dialog "ERROR: read myDate1"
end try

In AppleScriptObjC however, it displays the ERROR message.
When i change the first two lines to one single line: 

set myDate1 to date "Montag, 7. Dezember 2009 00:00:00"

There is no Error Message.

I don't quite understand why this is the case. Can anyone help me please?

Thanks, Bernhard

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: date works with literal, but not otherwise
  • Next by Date: Re: Applescriptobjc-dev Digest, Vol 2, Issue 2
  • Previous by thread: date works with literal, but not otherwise
  • Next by thread: Re: date works with literal, but not otherwise
  • Index(es):
    • Date
    • Thread