Mac application is not able control other application using apple event.

I am working on a mac application which controls some other mac application using apple events. So from my understanding whenever mac application tries to control other mac application using apple event for the first time, mac system will throw a dialog box with text saying something like "This application want to control this application" and we have to allow on the dialog box and once user allows the access to control the other app this will get reflected in 'automation' section for security and privacy setting, and user can access the application every time afterwards.

Before the notarization process becomes mandatory for all mac application everything was working fine, when my application tries to control other application system automatically throws the access dialog box. But once we have started the notarization process this dialog box is not appearing at all.

I have tried to find the solution on web, I have found one point that when user enabled 'Hardened Runtime' some of the functionality gets blocked like apple event is also part of that. So for the solution I have added the apple event entitlement('com.apple.security.automation.apple-events') with my application when I codesign my application and also added 'NSAppleEventsUsageDescription' in info.plist. But it is still not working. below is the command I use to code sign my application and 'MyApp.entitlements' file have the 'com.apple.security.automation.apple-events' entitlement.

codesign --deep --verify --verbose --force --timestamp --options runtime --entitlements "$PROJECT_ROOT/MyApp.entitlements" --sign "XYZ inc" "MyApp.app"

Is there anything I am missing to get the dialog box that is essential to access other app.

Thanks in advance for the help.

Replies

So for the solution I have added the apple event entitlement (com.apple.security.automation.apple-events) with my application when I codesign my application and also added NSAppleEventsUsageDescription

Right. That’s all that should be needed here.

below is the command I use to code sign my application

That command has two problems:

  • You are trying to both verify (--verify) and sign (--sign) your code. That’s contradictory, and I’ve no idea what the tool will do in that case.

  • You’re using --deep, which I specifically recommend against. See --deep Considered Harmful for an explanation as to why.

If you’re manually signing Mac code, read through the info in:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"