• 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: More date/time stuff
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More date/time stuff


  • Subject: Re: More date/time stuff
  • From: Paul Berkowitz <email@hidden>
  • Date: Thu, 19 Nov 2009 11:38:56 -0800
  • Thread-topic: More date/time stuff

Title: Re: More date/time stuff
We've been through this a hundred times. You can't set a list of properties of some object to a list of anything (text items, number items, application object items), although you can of course get a list of properties. You can, however, tell it to do so:

set today to current date
tell
today
   set {hours, minutes, seconds} to {0, 0, 0}
end tell
--> {0, 0, 0}

The one-liner

tell today to set {hours, minutes, seconds} to {0, 0, 0}


works just as well. (In a situation where 'its' is needed, it's needed before each property, not the list.)


--
Paul Berkowitz



From: "Stockly, Ed" <email@hidden>
Date: Thu, 19 Nov 2009 11:01:47 -0800
To: AppleScript-Users <email@hidden>
Subject: Re: More date/time stuff

I get the same result on Tiger.

This also works:

set today to current date
set {hours of today, minutes of today, seconds of today} to {0, 0, 0}

ES

On 11/19/09 8:58 AM, "Michelle Steiner"  wrote:
This works:

set today to current date
set
hours of today to 0
set minutes of today to 0
set seconds of today to 0

This doesn't:

set today to current date
set
{hours, minutes, seconds} of today to {0, 0, 0}

-->
error "Can’t set {hours of date \"Thursday, November 19, 2009 9:56:47 AM\", minutes of date \"Thursday, November 19, 2009 9:56:47 AM\", seconds of date \"Thursday, November 19, 2009 9:56:47 AM\"} to {0, 0, 0}. Access not allowed." number -10003 from {hours of date "Thursday, November 19, 2009 9:56:47 AM", minutes of date "Thursday, November 19, 2009 9:56:47 AM", seconds of date "Thursday, November 19, 2009 9:56:47 AM"}


-- Michelle


_______________________________________________
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
 _______________________________________________
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

  • Follow-Ups:
    • Re: More date/time stuff
      • From: Michelle Steiner <email@hidden>
    • Re: More date/time stuff
      • From: Emmanuel LEVY <email@hidden>
References: 
 >Re: More date/time stuff (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: More date/time stuff
  • Next by Date: Re: Basic Script Blues
  • Previous by thread: Re: More date/time stuff
  • Next by thread: Re: More date/time stuff
  • Index(es):
    • Date
    • Thread