Return Calendar ID

I’m executing the following script:

tell application “iCal”
tell calendar “Personal”
set theCurrentDate to current date
set theEventID to make new event at end with properties {description:“Event Description”, summary:“Event Name”, location:“Event Location”, start date:theCurrentDate, end date:theCurrentDate + 120 * minutes}
end tell
end tell

which returns the following:
→ event id “4C293420-4EC3-48E8-BD2B-59566562B460” of calendar id “193271EF-A9FE-4D7C-B5CF-0FB98166C100” of application “iCal”

The question is: How do I access the components of the result returned. I can get the UID of the event using (set myEventID to uid of theEventID) but need to understand how I get the “ID” of the calendar?

Hi,

very easy, put


set calendarID to uid

inside the tell calendar block

Stefan,

Thanks - works like a charm!!

Here’s the code:

tell application "iCal"
	tell calendar "Personal"
		set calendarID to uid
		set theCurrentDate to current date
		set theEventID to make new event at end with properties {description:"Event Description", summary:"Event Name", location:"Event Location", start date:theCurrentDate, end date:theCurrentDate + 120 * minutes}
		set eventID to uid of theEventID
		
		display dialog (eventID & " " & calendarID)
	end tell
end tell

Thanks for the help
Johann