• 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: Why is it?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Why is it?
      • From: kai <email@hidden>
    • Re: Why is it?
      • From: Michelle Steiner <email@hidden>
References: 
 >Why is it? (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Date trouble
  • Next by Date: Re: Why is it?
  • Previous by thread: Why is it?
  • Next by thread: Re: Why is it?
  • Index(es):
    • Date
    • Thread