• 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: Applescriptobjc-dev Digest, Vol 2, Issue 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescriptobjc-dev Digest, Vol 2, Issue 2


  • Subject: Re: Applescriptobjc-dev Digest, Vol 2, Issue 2
  • From: email@hidden
  • Date: Sat, 19 Dec 2009 13:36:52 +0100

Hi Jim

thanks for your help.

I need to deal with the date object, that's the crucial point here. i need something like this. it returns the correct weekday in AS-Editor, but the error in XCode:

set ThisMonth to "Januar"
set kalenderJahr to "2010"
set dateString to "1. " & ThisMonth & " " & the kalenderJahr & " 00:00:00"
try
set wochenTag to (weekday of date dateString) as string
on error
display dialog "ERROR: weekday of date " & dateString
end try
display dialog wochenTag


----------------------------------------------------------------------

Message: 1
Date: Thu, 17 Dec 2009 13:42:58 -0400
From: Jim Marsh <email@hidden>
Subject: Re: date works with literal, but not otherwise
To: email@hidden
Message-ID: <email@hidden">email@hidden>
Content-Type: text/plain; charset="us-ascii"

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.apple.com/pipermail/applescriptobjc-dev/attachments/20091217/c299527d/attachment.html

------------------------------

_______________________________________________
Applescriptobjc-dev mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescriptobjc-dev


End of Applescriptobjc-dev Digest, Vol 2, Issue 2
*************************************************

 _______________________________________________
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: Re: date works with literal, but not otherwise
  • Next by Date: Re: date works with literal, but not otherwise
  • Previous by thread: Re: date works with literal, but not otherwise
  • Next by thread: How to debug or develop incrementally in ASObjC?
  • Index(es):
    • Date
    • Thread