Re: Applescript-users Digest, Vol 2, Issue 627
Re: Applescript-users Digest, Vol 2, Issue 627
- Subject: Re: Applescript-users Digest, Vol 2, Issue 627
- From: Michelle Steiner <email@hidden>
- Date: Thu, 29 Sep 2005 14:31:37 -0700
On Sep 29, 2005, at 1:45 PM, chet kelley wrote:
if today is "Saturday" or "Sunday"
Well, first of all, today would be the full date, expressed as a
string. E.g., "Thursday, September 29, 2005"
Secondly, you're casting "saturday" and "sunday" as booleans, so that
comparison will always fail.
whose start date ≤ today
Thirdly, you're trying to compare a date to a string.
Try this:
set now to date string of (current date)
set today to weekday of (current date)
tell application "iCal"
if (today is Saturday) or (date now is Thursday) or (exists
(event in calendar "Travel" whose start date ≤ date now and end date
≥ date now) and (event in calendar "Federal Holidays" whose start
date ≤ date now and end date ≥ date now)) then
display dialog "have fun sleeping in"
else
tell application "iTunes" to play track "Hells Bells"
end if
end tell
-- Michelle
--
Help, I've caught a cult, and can't get out!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden