• 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
tell or not to tell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tell or not to tell


  • Subject: tell or not to tell
  • From: Skeeve <email@hidden>
  • Date: Thu, 10 Jan 2008 09:35:56 +0100

can someone tell me why "tell" does not work here?

Working handler:

on last_weekday(a_weekday, the_date)
copy the_date to a_date
set day of a_date to 1
if month of a_date as integer is 12 then
set month of a_date to 1
set year of a_date to (year of a_date) + 1
else
set month of a_date to (month of a_date) + 1
end if
set a_date to a_date + (((7 + a_weekday - (weekday of a_date) as integer) mod 7) - 7) * days
return a_date
end last_weekday



Can be called with

display dialog "Last " & last_weekday(Monday, current date)

to find the last Monday of the given month.

I wanted to save some of the "of a_date"s above so thought this should work, but it didn't even compile:

on last_weekday(a_weekday, the_date)
copy the_date to a_date
tell a_date
set day to 1
if month as integer is 12 then
set month to 1
set year to year + 1
else
set month to month as integer + 1
end if
end tell
set a_date to a_date + (((7 + a_weekday - (weekday of a_date) as integer) mod 7) - 7) * days
return a_date
end last_weekday


_______________________________________________
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: tell or not to tell
      • From: Michelle Steiner <email@hidden>
    • Re: tell or not to tell
      • From: Christopher Nebel <email@hidden>
  • Prev by Date: Can someone please explain (Language Guide)
  • Next by Date: Re: Can someone please explain (Language Guide)
  • Previous by thread: Re: Can someone please explain (Language Guide)
  • Next by thread: Re: tell or not to tell
  • Index(es):
    • Date
    • Thread