I created an app in Xcode using ApplescriptObjC that is supposed to communicate with Finder and Adobe Illustrator. It has been working for the last 8 years, until now I have updated it for Sonoma and it no longer triggers the alerts for the user to approve the communication. It sends the Apple Events, but instead of the alert dialog I get this error in Console:
"Sandboxed application with pid 15728 attempted to lookup App: "Finder"/"finder"/"com.apple.finder" 654/0x0:0x1d01d MACSstill-hintable sess=100017 but was denied due to sandboxing."
The Illustrator error is prdictably similar.
I added this to the app.entitlements file:
<key>com.apple.security.automation.apple-events</key>
<array>
<string>com.apple.finder</string>
<string>com.adobe.illustrator</string>
</array>
I added this to Info.plist:
<key>NSAppleEventsUsageDescription</key>
<string>This app requires access to Finder and Adobe Illustrator for automation.</string>
I built the app, signed with the correct Developer ID Application Certificate.
I've also packaged it into a signed DMG and installed it, with the same result as running it from Xcode.
I tried stripping it down to just the lines of code that communicate with Finder and Illustrator, and built it with a different bundle identifier with the same result.
What am I missing?
Also, you will need to add an Apple Event Temporary Exception entitlement to your app so it can talk to Illustrator. Please see The following for more details: Entitlement Key Reference: App Sandbox Temporary Exception Entitlements