简体   繁体   English

Mac应用程序提示用户进行全盘访问

[英]Mac app to prompt user for Full Disk Access

How can a Mac app (eg written in Shell or Python) verify whether it has Full Disk Access and, if it does not, prompt the user to add the app to Full Disk Access with a single button click (similar to the image below)? Mac应用程序(例如用Shell或Python编写)如何验证其是否具有“ 全盘访问”权限 ,如果没有,则提示用户通过单击一个按钮将应用程序添加到“全盘访问”中(类似于下图) ?

For example, a URL formatted as x-apple.systempreferences:com.apple.preference.security?Privacy can open the Privacy settings on a Mac. 例如,设置为x-apple.systempreferences:com.apple.preference.security?Privacy的URL可以在Mac上打开“隐私”设置。 Can something similar be created using Python? 可以使用Python创建类似的东西吗?

I want this to be as user-friendly as possible, so I prefer not requiring the user to search for the 'Full Disk Access' window, then search through a list for the app, then have to select the app and add it to the allowed-list etc. etc. 我希望它尽可能地方便用户使用,所以我宁愿不要求用户搜索“ Full Disk Access”窗口,然后在列表中搜索该应用程序,然后选择该应用程序并将其添加到允许清单等

提示

This Python code will open Disk Access Preferences window. 此Python代码将打开“磁盘访问首选项”窗口。 You can add a window to your program with something like: Please give me disk access. 您可以使用以下方式向程序添加窗口: 请给我磁盘访问权限。 I promise to not delete your files. 我保证不会删除您的文件。 -App -应用程式

import webbrowser
webbrowser.open('x-apple.systempreferences:com.apple.preference.security?Privacy')

(Sorry if this is not what you were looking for) (很抱歉,如果这不是您想要的东西)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM