Re: Can't Coerce String to Date?
Re: Can't Coerce String to Date?
- Subject: Re: Can't Coerce String to Date?
- From: Alex Hall <email@hidden>
- Date: Fri, 13 Mar 2015 15:14:53 -0400
On Mar 13, 2015, at 2:09 PM, Yvan KOENIG < email@hidden> wrote:
Now that my newest script uses NSDates, I'm trying to give those to this handler. Of course it won't work directly, so I need to put the NSDate into the AppleScript date type. I thought it would be easy:
set startDateString to (e's startDate()'s |description|()) as text set startDate to (word 2 of startDateString & "/" & word 3 of startDateString & "/" & word 1 of startDateString) as date
In that snippet, "e" is an EKEvent. I don't get an error requesting e's date; rather I get an error that "can't convert "03/20/2015" to date". Yet, according to Google, AS can easily convert a string like that. The time will be midnight, but I can add the time in once this part is working. What am I doing wrong, or did something change because I'm using Yosemite and/or scripting additions?
--
Have a great day, Alex Hall
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden