How to send an iCal event's attendee their invitation

Hello All,

I can create an iCal event and add an attendee (with an email address).
Everything shows up fine in iCal (the event’s info drawer show my attendee and the email address).
At the bottom of the info drawer is a button (“Send”) to send the invitation to the invitee.
How do I get iCal to mail the event?
Following is the script that creates the event:

set dayStart to date "Sunday, July 15, 2007 11:30:00 AM"
set dayEnd to date "Sunday, July 15, 2007 2:00:00 PM"
tell application "iCal"
   tell calendar "Filled"
       set new_event to make new event at end of events with properties {start date:dayStart, end date:dayEnd, summary:"Super Interesting Meeting"}
   end tell
   tell new_event
       make new attendee at beginning of attendees with properties {display name:"Bill Lee", email:""}
   end tell
   --how to send invitation that iCal would send if the Send invitation button was clicked !!!
end tell


I don’t do what you want to do, but here’s a framework to build on:

tell application "iCal" to tell calendar "filled"
	set E to events
	repeat with anE in E -- take them one at a time
		set att to attendees of anE -- get the list of attendees
		set Sumry to summary of anE -- get the message to be sent
		repeat with anA in att -- take the attendees one at a time
			set M to email of anA -- get the email address
			set N to display name of anA -- get the name entered in the list
			tell application "Mail"
				-- build your email here; I don't know what you want in it
			end tell
		end repeat
	end repeat
end tell

Hi All,

The script created an event in iCal.
I would like to send the attendee(s) of the created event their invitation(s)
In this case sending an email with:
subject: iCal event invitation: Super Interesting Meeting
body: Bill Lee has invited you to the iCal event: Super Interesting Meeting, scheduled for July 15, 2007 at 11:30 AM (US/Pacific). To accept or decline this invitation, click the link below
attachment: iCal-20070715-172442.ics
The attachment contains the event info:
PRODID:-//Apple Computer, Inc//iCal 2.0//EN

This is what would be sent if the button at the bottom of the created event’s info drawer “Send” was clicked.
Do I have to build up the event’s invitation email from scratch or is there a way to have iCal send its invitation?

To see this behavior, create an ical event, add an attendee from the address book, click the send button at the bottom of the info window, and look in the sent folder in mail.