Re: Coerce date saved as text back to Applescript's date format?
Re: Coerce date saved as text back to Applescript's date format?
- Subject: Re: Coerce date saved as text back to Applescript's date format?
- From: Jake Pietrykowski <email@hidden>
- Date: Mon, 20 Dec 2004 14:04:37 -0600
Well...I 'thought' I was doing it right! ;-)
Thanks...turns out not only was I using an 'incorrect' date...
I was attempting to set theDate to date (theString) inside of a 'tell window
theWindow' in my AppleScript Studio app. Move it outside and all is well.
Thanks,
Jake
On 12/20/04 1:54 PM, "Andrew Oliver" <email@hidden> wrote:
> On 12/20/04 11:47 AM, "Jake Pietrykowski" <email@hidden> wrote:
>
>> How can I coerce the following text data:
>>
>> "Friday, December 16, 2004 11:24:05 AM"
>>
>> back into Applescript's date format?
>
> Trick question!
>
> You can't because there is no such date as "Friday December 16, 2004"
>
> In 2004, December 16th was a Thursday.
>
> That said, assuming you have a valid date string you can coerce it to a date
> object by simply:
>
> set theString to "Thursday December 16, 2004 11:24:05 AM"
> set theDate to (date theString)
>
> But the string has to be something AppleScript can reasonably coerce to a
> date.
>
> Andrew
> :)
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden