I'm trying to install fonts by using AppleScript. The script is running successfully and it installed the font from script editor, but when trying to run from my application it's failing with this message:
NSAppleScriptErrorBriefMessage - Not authorized to send Apple events to Font Book.
I have tried most of the suggested solutions from this link: How to run an AppleScript from a sandboxed application on a Mac (OS X), but it doesn't work.
The following is the content of file App.entitlements:
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.apple.finder</string>
<string>com.apple.systemevents</string>
<string>com.apple.FontBook</string>
<string>com.microsoft.Word</string>
</array>
<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.apple.FontBook</key>
<string>com.apple.FontBook</string>
</dict>
</dict>
and adding the following in Info.plist:
<key>NSAppleEventsUsageDescription</key>
<string>Please give Unread Mail access to Mail via Apple Script.</string>