selecting stuff iCal


i am trying to write an script that is triggered by ical to send texts and emails to clients whose appointments are logged in ical (as events).
The problem I have is that I can’t seem to get a list of events for a particular day.
I can get all events and properties of event 1(2345…) but I can’t get an event on a chosen day or a list for a chosen day
set x to show event with end date date “Friday, December 7, 2007 09:00:00” simply does not work (paraphrase)
I worked out most of the other stuff and thought this bit might be easy… something like
set x to (day of (current date)) - 2
do script “ladedah”
if those commands were in its dictionary but of course they are not.
I have tried looking at automater as well but that seems to produce the wrong type of result

Any ideas??


it can take a while, this is a possible solution

tell (current date) to set today to its date string
set todaysEvents to {}
tell application "iCal"
	repeat with cal in calendars
		repeat with oneEvent in (get events of cal)
			if date string of (get start date of oneEvent) is today then set end of todaysEvents to contents of oneEvent
		end repeat
	end repeat
end tell

Thank you Stefan

I have re gigged yours a little and this solution works a lot faster. It took around 30 sec to extract the data from a very full year long calender

tell (current date) to set today to its date string

set todaysEvents to {}
tell application "iCal"
	set e_vent to every event in calendar "new"
	repeat with i from 1 to number of items in e_vent
		set this_item to item i of e_vent
		set startdate to start date of this_item --of calendar "new"
		set startdate to date string of startdate
		if startdate is today then
			set the end of todaysEvents to properties of event 1 of calendar "new"
		end if
	end repeat
end tell
return todaysEvents

I am sure there is a more elegant solution