• 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: chet kelley <email@hidden>
  • Date: Thu, 29 Sep 2005 20:07:29 -0400

"iCal got a
        "iCal got an error: Can't make event of calendar \"Work\" whose start date ≤ date \"Thursday, September 29, 2005\" and end date ≥ date \"Thursday, September 29, 2005\" into type reference."

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: Dave Lyons <email@hidden>
References: 
 >Re: Applescript-users Digest, Vol 2, Issue 627 (From: chet kelley <email@hidden>)
 >Re: Applescript-users Digest, Vol 2, Issue 627 (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: make a new folder within an exisitng folder
  • Next by Date: Re: code reuse
  • 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