Re: Why is it?
Re: Why is it?
- Subject: Re: Why is it?
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 20 Oct 2006 11:01:27 -0400
On 10/20/06, Michelle Steiner <email@hidden> wrote:
{year of d, month of d as integer, day of d} as text
--> ""
but
set foo to {year of d, month of d as integer, day of d}
foo as text
--> "2006-10-20 7:41:26 AM"
Well, it seems the first form doesn't actually dereference the fields:
{year of d, month of d as integer, day of d} as list
--> {year of date "Friday, October 20, 2006 10:58:17 AM", 10, day of
date "Friday, October 20, 2006 10:58:17 AM"}
The coercion "as integer" forces "month of d" to be resolved, but the
other two are just references back to the structure, and their
presence seems to prevent the text conversion. The assignment forces
resolution across the board:
set foo to {year of d, month of d as integer, day of d}
foo as list
--> {2006, 10, 20}
As usual, you can achieve the desired result by using get:
{get year of d, month of d as integer, get day of d} as text
--> "2006-10-20"
--
Mark J. Reed <email@hidden>
_______________________________________________
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
References: | |
| >Why is it? (From: Michelle Steiner <email@hidden>) |