• 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: Date of next Thursday. An OT response.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date of next Thursday. An OT response.


  • Subject: Re: Date of next Thursday. An OT response.
  • From: Paul Skinner <email@hidden>
  • Date: Wed, 15 Nov 2000 22:45:06 -0500

The AppleScript Matrix continues...

>> Is there an easy method to get the date of next Thursday in a script
>> without a lot of if/thens?

Nigel replied to agent Smith by springing into a crouch on the ceiling
only to explode down on him with a perfect spinning tripple-axle flying
kick...

> From: Nigel
> set dref to date "Thursday, 6 January 2000 00:00:00"
> set nextThursday to dref + (round (((current date) - dref) / weeks)
> rounding up) * weeks
>
> NG

BLAM!

Before he could shake his disbelief, from out of the shadows, Michelle
sprang towards the staggering agent and finished him with a barrage of
parenthetical chops to to his syntax!

> From: Michelle
> Wonderful! May I add a very small enhancement?
>
> set nextThursday to date string of (dref + (round ((((current date) + 47
> * days) - dref) / weeks) rounding up) * weeks)
>
> This removes the time from the result, leaving only the date.
>
> --Michelle

WHACK, BLAM, KA-WHACK, WUH-BLAM!

I love this stuff!
Paul

p.s. In no way am I implying that Dave Balderstone is or is not currently an
agent. 8^ )


  • Prev by Date: Re: Date of next Thursday
  • Next by Date: Re: Most Scriptable Apps (was: Can a script receive AppleEvents?)
  • Previous by thread: Re: Remote access disconnect script.
  • Next by thread: Re: Most Scriptable Apps (was: Can a script receive AppleEvents?)
  • Index(es):
    • Date
    • Thread