tell or not to tell
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