getting the list of calendars using applescript ?

Hi everyone,

I’m trying to get a list of all available calendars in my calendar application. macos 10.11.
I updated an old realbasic app named “ical test” , basically making a toolbar again as it did not survive the opening process of xojo 2019r11…
it is working, I launch it and it asks me if I allow the app to connect to the calendar app, but the returned list is empty.

the applescript used, below, works fine if I paste it in the script editor and run it.

on run
	tell application "Calendar"
		set ListOfCalendars to "" as string
		set i to 1
		set noOfCal to number of calendars
		repeat until i = noOfCal + 1
			set myCal to calendar i
			set ListOfCalendars to ListOfCalendars & {title of myCal} & (ASCII character 9) & {uid of myCal} & (ASCII character 13)
			set i to i + 1
		end repeat
		return ListOfCalendars
	end tell
end run

later, I added an info.plist file (below) but it doesn’t change anything, the returned list is empty.

[code]<?xml version="1.0" encoding="UTF-8"?>

NSCalendarsUsageDescription $(PRODUCT_NAME) user your calendar. NSAppleEventsUsageDescription $(PRODUCT_NAME) uses Applescript for its own purposes. [/code]

what did I miss ?
thanks.

nothing that I can see
I have that exact script in some other source code on 10.14.6 and it also has this issue
I just hadnt needed that app at this time

well I changed return ListOfCalendars to return "5"
and I was able to get the “5” back into xojo, but only one time ! now it does not work anymore …

tried to only return 2-3 calendars as the applescript takes 2.5s to execute on my system, but it does not work either.
really I don’t understand what’s happening here …

makes no sense to me either since the list IS just an apple script string same as “5” is
just that from the calendars its longer an delimied with tabs and newlines but …

bug report time ?

I added the key :

<key>com.apple.security.automation.apple-events</key> <true/>
to the plist file and it is still the same: nothing returned from the applescript.

[quote=484249:@Norman Palardy]
bug report time ?[/quote]

<https://xojo.com/issue/59789>