• 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, Issue 627
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Applescript-users Digest, Vol 2, Issue 627
      • From: chet kelley <email@hidden>
References: 
 >Re: Applescript-users Digest, Vol 2, Issue 627 (From: chet kelley <email@hidden>)

  • Prev by Date: Re: 'inconsistency' [was: Re: AppleScript a miserable and utter failure]
  • Next by Date: Re: make a new folder within an exisitng folder
  • Previous by thread: Re: Applescript-users Digest, Vol 2, Issue 627
  • Next by thread: Re: Applescript-users Digest, Vol 2, Issue 627
  • Index(es):
    • Date
    • Thread