Sandboxing my App with Scripting Bridge to send email

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 05:29:51

You can't use the ScriptingBridge with Sandboxing enabled. Please file a bug report. This is what Apple recommends, if Sandboxing is a problem for you and there are no other solutions. They might add entitlements (not just temporary exceptions) for the ScriptingBridge, but as of now there is no further information available.

There are Entitlements Keys, especially the com.apple.security.temporary-exception.apple-events key, you can add to your Entitlements.plist file, but the key for Apple Events is a temporary exception.
Unfortunately, I was unable to get ScriptingBridge working even with the correct entitlements set. I hope you're luckier than me.

Apple is going to require Sandboxing for all apps submitted to the Mac App Store starting on the 1st of November!

com.apple.security.temporary-exception.apple-events

Add this code to your Entitlements.plist, I tested It's ok.I can get selected mail from Mail now.

    <key>com.apple.security.temporary-exception.apple-events</key>
    <array>
    <string>com.apple.mail</string>
    </array>

I have modified Apple's SBSendEmail sample application to be Sandboxed and can successfully compose an e-mail. It appears that it is not possible to send the e-mail, but at least you could set everything up for the user just to press send.

https://github.com/Whiffer/SBSendEmail

of mac os x 10.8 and later, it has changed:

<key>com.apple.security.scripting-targets</key>
<dict>
    <key>com.apple.mail</key>
    <array>
        <string>com.apple.mail.compose</string>
    </array>
</dict>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!