• 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: Emmanuel LEVY <email@hidden>
  • Date: Thu, 19 Nov 2009 22:01:25 +0100

I wouldn't try this script.

If I'm correct, the script below won't change "today". It will only change the AppleScript constant "hours" (which usually evaluates to 3600) into 0, and same for "minutes" (was 60, is now 0).

Emmanuel


On Nov 19, 2009, at 8:38 PM, Paul Berkowitz wrote:

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.

Or just as bad.

set today to current date
tell today to set {hours, minutes, seconds} to {0, 0, 0}
today
-- date "Thursday, November 19, 2009 9:58:04 PM"

_______________________________________________
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: Paul Berkowitz <email@hidden>
References: 
 >Re: More date/time stuff (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: XML handling
  • 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