1

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>
TylerP
  • 9,600
  • 4
  • 39
  • 43
mahmoud
  • 11
  • 3
  • Do it during the software installation (the installer is granted to run scripts of this kind - or it will ask authorization to the user) . Alternatively you could put your font within your resources and use it from there. – dspr Dec 19 '20 at 20:02
  • the application it self has no problem for using Custom fonts , but my problem how to use these custom fonts for all installed applications running on user MACOS – mahmoud Dec 19 '20 at 20:42
  • 1
    What is your question? Is it about running an AppleScript scrit? Or is it about installing fonts? "I have tried most of the suggested solutions from this link" Which ones and how!? – El Tomato Dec 19 '20 at 22:46
  • when trying to run AppleScript from my application it's failing with this message:NSAppleScriptErrorBriefMessage - Not authorized to send Apple events to Font Book. despite when running apple script from script editor The script is running successfully – mahmoud Dec 20 '20 at 06:03

0 Answers0