在沙盒应用程序中获取Mac上用户下载文件夹的API

在沙盒应用程序中获取Mac上用户下载文件夹的API

问题描述:

如何在沙盒Mac应用程序中获取用户的下载文件夹,即(〜/Downloads)?

How to get the user's downloads folder, i.e., (~/Downloads) in a sandboxed mac app?

感谢帮助!

您可以为下载"文件夹添加权利.

There is an entitlement you can add for the Downloads folder.

根据此Apple文档,您可以在应用的权利文件中添加"com.apple.security.files.downloads.read-write".

According to this Apple document, you can add "com.apple.security.files.downloads.read-write" to your app's entitlements file.