Re: Getting recurring event instance for specific day in iCal
Re: Getting recurring event instance for specific day in iCal
- Subject: Re: Getting recurring event instance for specific day in iCal
- From: Ed Stockly <email@hidden>
- Date: Sat, 7 Jun 2008 18:38:56 -0700
On Jun 7, 2008, at 5:26 PM, Justin Williams wrote:
tell application "iCal"
activate
tell calendar "Personal"
set theEvent to first event whose summary = "Gym" and start
date =
"Saturday, June 7, 2008 9:45AM"
show theEvent
end tell
end tell
Hmmm, I see a few things that might be wrong here... But I've only
toyed with ical, and haven't upgraded in a while and I'm on tiger, so
I may be off base.
First, I've found very few situations where you can use a compound
whose statement.
every foo whose x = y and b = c
Doesn't really work consistently.
Second, for your start date, your asking iCal to compare a string
with a date, and I think you need to coerce the string to a date by
inserting the word date.
start date > date "6/7/08"
Finally, when you have a compound statement that you're trying to
debug, break it into its smallest parts first, make sure each work,
then build it up again.
In this case I couldn't get the date filter as you specified to work,
but it did work with < and >
tell application "iCal"
activate
tell calendar "Work"
set theEvent to first event whose (summary = "Payday")
set theEvent to first event whose start date > date "Friday,
June 6, 2008 12:00:00 AM"
end tell
end tell
You may need to do something like then
set myEvents to every event whose start date > date "Friday, June 6,
2008 12:00:00 AM"
repeat with thisEvent in myEvents
if the summary of thisEvent = "Payday" then exit repeat
end repeat
HTH,
ES
_______________________________________________
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