In our application we start and close external applications.
Applications are started by opening the document/Uri of corresponding application.
these application are later closed by using apple script
osascript -e 'tell application \"APP_NAME\" to quit'
This works in normal mode, but not in sandbox mode.
I tried with following entitlements
<key>com.apple.security.temporary-exception.apple-events</key>
<array>
<string>com.microsoft.SkypeForBusiness</string>
<string>com.logmein.GoToMeeting</string>
</array>
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.microsoft.SkypeForBusiness</key>
<array>
<string>com.apple.systemevents</string>
</array>
<key>com.logmein.GoToMeeting</key>
<array>
<string>com.apple.systemevents</string>
</array>
</dict>
and in info.plist
<key>NSAppleEventsUsageDescription</key>
<string>Close apps started by this application</string>
But I get error privilege violation occurred.
GoToMeeting is downloaded from thier website in dmg format and Skype for buisness is pkg.
Is there any issue with entitlements used or any other way to close open apps?
Mac OS used: 10.13.6
Development platform: electron