• 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: applescript-users digest, Vol 2 #42 - 14 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 2 #42 - 14 msgs


  • Subject: Re: applescript-users digest, Vol 2 #42 - 14 msgs
  • From: "Marc K. Myers" <email@hidden>
  • Date: Wed, 15 Nov 2000 13:51:57 -0500
  • Organization: [very little]

Dave Balderstone wrote:
> Date: Wed, 15 Nov 2000 11:46:07 -0600
> To: email@hidden
> From: Dave Balderstone <email@hidden>
> Subject: Date of next Thursday
>
> Is there an easy method to get the date of next Thursday in a script
> without a lot of if/thens?
>
> I'm working on a script to change folio dates in Xpress templates,
> and rather than relying on a user to enter the correct date, I'd like
> to be able to have the script say, in essence, "If (current date) is
> Friday, December 29, 2000 then next Thursday will be January 4, 2001"
> store that into a variable so I can extract the info I need.
>
> Thanks in advance.
>
> Dave Balderstone

Here's a method w/o any "ifs":

set thisDate to (current date)
set thisDay to weekday of thisDate
repeat until thisDay is Thursday
set thisDate to thisDate + (1 * days)
set thisDay to weekday of thisDate
end repeat
date string of thisDate

Marc [11/15/00 1:51:43 PM]


  • Prev by Date: Re: Need a mouseup click in a specific location of the screen
  • Next by Date: Re: Date of next Thursday
  • Previous by thread: Re: Most Scriptable Apps (was: Re: Can a script receive AppleEvents?)
  • Next by thread: TECSoft's New & Improved AppleScript Training
  • Index(es):
    • Date
    • Thread