Catalina & AEDeterminePermissionToAutomateTarget

Folks;


I'm seeing some behavior I don't understand related to 'Privacy : Automation' (Xcode 11.4 Catalina 10.15.4)


My macOS app uses AppleScript to interact with ~20 other mainstream macOS applications (Safari, Chrome, Word, etc..)

All of this used to work in Mojave (and I'm pretty certain earlier Catalina)


I've been noticing some strange results during testing so I have reset Privacy for my app using 'tccutil reset All com.someName.myAppName'

This reset has been successful - in System Preferences I no longer see my app under the 'Automation' area.


HOWEVER

when my app is about to execute AppleScript to another app it first executes:

OSStatus status = AEDeterminePermissionToAutomateTarget(targetAppEventDescriptor.aeDesc, typeWildCard, typeWildCard, false);

after the reset above, this now returns 'errAEEventWouldRequireUserConsent'

after receiving this 'wouldRequire' response my app executes:

OSStatus status = AEDeterminePermissionToAutomateTarget(targetAppEventDescriptor.aeDesc, typeWildCard, typeWildCard, true);

this is now ALWAYS returning 'errAEEventNotPermitted'.


This paradigm used to work very nicely.


Is there some information that I have missed?

My hunch is that 'typeWildCard' for AEEventClass and AEEventID are now problematic...


Any help here would be deeply appreciated!

Steve

Accepted Reply

Hey Just found the answer!!


The hardened runtime requires an additional entitlement: com.apple.security.automation.apple-events


Sanity restored!

Replies

Hey Just found the answer!!


The hardened runtime requires an additional entitlement: com.apple.security.automation.apple-events


Sanity restored!