NSAppleEventsUsageDescription entitlement without a development certificate for local use

I am trying to build a macOS application that invokes NSAppleScript that controls Safari, but in order to do so, I need the NSAppleEventsUsageDescription entitlement set. However, this entitlement requires, from my understanding, a paid developer account for the signing certificate (free provisioned certificates don't appear to be able to work). I only want to be able to run this application locally for personal use.

Here are some less than ideal options I've considered:

  • Invoking NSUserAppleScriptTask instead and creating custom script files
  • Running the generated application binary directly from Terminal which supports these entitlements
  • Using SafariServices (however when I tried doing so, functions like getAllWindows would not seem to fire but this is a separate issue)
  • Code signing with a self generated local root certificate (this did not work)
  • Buying into the paid developer programme (I'd rather not)

Are there any other options?

I am on macOS Monterey 12.4 and using Xcode 13.4.1.

Accepted Answer

The key: NSAppleEventsUsageDescription goes in the Info.plist file (or Info tab in modern project versions), not the entitlements file (my bad! I feel that the error emitted by Xcode is misleading). This works without needing a development certificate.

The key NSAppleEventsUsageDescription goes in the Info.plist file

Correct.

free provisioned certificates don't appear to be able to work

Once you’ve fixed this NSAppleEventsUsageDescription issue, you should be able to use a free code signing (your Personal Team) for this. And I encourage you to do so. TCC uses your code signature to track privileges, and so you will run into confusing problems if you don’t have a stable signature. See TN3127 Inside Code Signing: Requirements for the gory details here.

Share and Enjoy

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

NSAppleEventsUsageDescription entitlement without a development certificate for local use
 
 
Q