在沙盒中从 objective c/swift 重置 Finder

reseting Finder from objective c/swift in sandbox

我正在尝试从我的代码(在沙盒中)中恢复 Finder。我尝试的一种方法是调用以下苹果脚本:

tell application \"Finder\" to quit

但在小牛队似乎不起作用。有什么想法吗?

您需要添加 com.apple.security.scripting-targets 沙盒授权才能从沙盒中为其他应用程序编写脚本。请检查 How to run an AppleScript from a sandboxed application on a Mac (OS X)