Reading properties returned by Calendar Lib EC

The fetch calendars command returns a list of calendars. I have a loop that iterates through the items in the list seeking the desired calendar. Here is the fully working loop:

repeat with tCal in pAllCals
   if tCal's title() as string = pSourceCalendarName  then
		set tSourceCal to tCal
		set tSourceEvents to fetch events starting date pStartDt ending date pEndDt searching cals {tCal} event store pTheStore
		exit repeat
	end if
end repeat

The variable tCal contains more than just the title :

EKCalendar <0x600000054640> {title = QEHS Holidays; type = CalDAV; allowsModify = YES; color = #82DCB2FF;}

I am trying to read/extract the status of allowsModify but am failing and I do not know what type tCal is. What I mean is that it does not seem to be either a list or a record yet I am able to extract the value of the title through the use of title() which I guess is a function of some sort . I have looked at the script of the library but am none the wiser.

repeat with tCal in pAllCals
		set tTest to tCal's allowsModify() as boolean
		if not tTest then
			display dialog "Calendar does not allow edits."
		end if
		if tCal's title() as string = pSourceCalendarName and tCal's allowsModify = yes then
			set tSourceCal to tCal
			set tSourceEvents to fetch events starting date pStartDt ending date pEndDt searching cals {tCal} event store pTheStore
			exit repeat
		end if
	end repeat

raises this error

-[EKCalendar allowsModify]: unrecognized selector sent to instance 0x600000309040

Any thoughts?

S

For those who may not be aware of this, CalendarLib EC is a script library written by Shane. It can be found at:

It doesn’t really – that’s the description of the calendar returned, with extra information added for convenience. The method you want is isImmutable, something like:

		set tTest to tCal's isImmutable() as boolean
		if tTest then
			display dialog "Calendar does not allow edits."
		end if

Shane_Stanley, Many thanks, I can stop pulling my hair out now!

Simon