gpt4 book ai didi

Cocoa 按钮打开系统偏好设置页面

转载 作者:行者123 更新时间:2023-12-03 16:01:45 24 4
gpt4 key购买 nike

在 OSX Cocoa 应用程序中,我想要一个可以打开“语音”首选项 Pane 的按钮。那可能吗?我只是想节省他们的时间去“系统偏好设置”>“语音”>“文本到语音”

最佳答案

人们甚至可以在首选项 Pane 中选择特定的子项目。以下是在“隐私” Pane 下选择“相机”的示例:

NSURL *URL = [NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Camera"];
[[NSWorkspace sharedWorkspace] openURL:URL];

一些功劳归功于以下网站:https://macosxautomation.com/system-prefs-links.html

供引用的 URL 列表(*针对 macOS Big Sur、Catalina 和 Mojave 进行了更新):

Accessibility Preference Pane
Main x-apple.systempreferences:com.apple.preference.universalaccess
Display x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_Display
Zoom x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_Zoom
VoiceOver x-apple.systempreferences:com.apple.preference.universalaccess?Seeing_VoiceOver
Descriptions x-apple.systempreferences:com.apple.preference.universalaccess?Media_Descriptions
Captions x-apple.systempreferences:com.apple.preference.universalaccess?Captioning
Audio x-apple.systempreferences:com.apple.preference.universalaccess?Hearing
Keyboard x-apple.systempreferences:com.apple.preference.universalaccess?Keyboard
Mouse & Trackpad x-apple.systempreferences:com.apple.preference.universalaccess?Mouse
Switch Control x-apple.systempreferences:com.apple.preference.universalaccess?Switch
Dictation x-apple.systempreferences:com.apple.preference.universalaccess?SpeakableItems

Security & Privacy Preference Pane
Main x-apple.systempreferences:com.apple.preference.security
General x-apple.systempreferences:com.apple.preference.security?General
FileVault x-apple.systempreferences:com.apple.preference.security?FDE
Firewall x-apple.systempreferences:com.apple.preference.security?Firewall
Advanced x-apple.systempreferences:com.apple.preference.security?Advanced
Privacy x-apple.systempreferences:com.apple.preference.security?Privacy
Privacy-Camera x-apple.systempreferences:com.apple.preference.security?Privacy_Camera
Privacy-Microphone x-apple.systempreferences:com.apple.preference.security?Privacy_Microphone
Privacy-Automation x-apple.systempreferences:com.apple.preference.security?Privacy_Automation
Privacy-AllFiles x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles
Privacy-Accessibility x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility
Privacy-Assistive x-apple.systempreferences:com.apple.preference.security?Privacy_Assistive
Privacy-Location Services x-apple.systempreferences:com.apple.preference.security?Privacy_LocationServices
Privacy-SystemServices x-apple.systempreferences:com.apple.preference.security?Privacy_SystemServices
Privacy-Advertising x-apple.systempreferences:com.apple.preference.security?Privacy_Advertising
Privacy-Contacts x-apple.systempreferences:com.apple.preference.security?Privacy_Contacts
Privacy-Diagnostics & Usage x-apple.systempreferences:com.apple.preference.security?Privacy_Diagnostics
Privacy-Calendars x-apple.systempreferences:com.apple.preference.security?Privacy_Calendars
Privacy-Reminders x-apple.systempreferences:com.apple.preference.security?Privacy_Reminders
Privacy-Facebook x-apple.systempreferences:com.apple.preference.security?Privacy_Facebook
Privacy-LinkedIn x-apple.systempreferences:com.apple.preference.security?Privacy_LinkedIn
Privacy-Twitter x-apple.systempreferences:com.apple.preference.security?Privacy_Twitter
Privacy-Weibo x-apple.systempreferences:com.apple.preference.security?Privacy_Weibo
Privacy-Tencent Weibo x-apple.systempreferences:com.apple.preference.security?Privacy_TencentWeibo

macOS Catalina 10.15:
Privacy-ScreenCapture x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture
Privacy-DevTools x-apple.systempreferences:com.apple.preference.security?Privacy_DevTools
Privacy-InputMonitoring x-apple.systempreferences:com.apple.preference.security?Privacy_ListenEvent
Privacy-DesktopFolder x-apple.systempreferences:com.apple.preference.security?Privacy_DesktopFolder
Privacy-DocumentsFolder x-apple.systempreferences:com.apple.preference.security?Privacy_DocumentsFolder
Privacy-DownloadsFolder x-apple.systempreferences:com.apple.preference.security?Privacy_DownloadsFolder
Privacy-NetworkVolume x-apple.systempreferences:com.apple.preference.security?Privacy_NetworkVolume
Privacy-RemovableVolume x-apple.systempreferences:com.apple.preference.security?Privacy_RemovableVolume
Privacy-SpeechRecognition x-apple.systempreferences:com.apple.preference.security?Privacy_SpeechRecognition

macOS Big Sur 10.11/10.16:
Privacy-Bluetooth x-apple.systempreferences:com.apple.preference.security?Privacy_Bluetooth
Privacy-Music x-apple.systempreferences:com.apple.preference.security?Privacy_Media
Privacy-Home x-apple.systempreferences:com.apple.preference.security?Privacy_HomeKit

macOS Monterey 12.0:
Privacy-DoNotDisturb x-apple.systempreferences:com.apple.preference.security?Privacy_Focus

macOS Ventura 13.0:
Privacy-AppBundles x-apple.systempreferences:com.apple.preference.security?Privacy_AppBundles
Privacy-ListenEvent x-apple.systempreferences:com.apple.preference.security?Privacy_ListenEvent


Dictation & Speech Preference Pane
Dictation x-apple.systempreferences:com.apple.preference.speech?Dictation
Text to Speech x-apple.systempreferences:com.apple.preference.speech?TTS
Sharing Preference Pane
Main x-apple.systempreferences:com.apple.preferences.sharing
Screen Sharing x-apple.systempreferences:com.apple.preferences.sharing?Services_ScreenSharing
File Sharing x-apple.systempreferences:com.apple.preferences.sharing?Services_PersonalFileSharing
Printer Sharing x-apple.systempreferences:com.apple.preferences.sharing?Services_PrinterSharing
Remote Login x-apple.systempreferences:com.apple.preferences.sharing?Services_RemoteLogin
Remote Management x-apple.systempreferences:com.apple.preferences.sharing?Services_ARDService
Remote Apple Events x-apple.systempreferences:com.apple.preferences.sharing?Services_RemoteAppleEvent
Internet Sharing x-apple.systempreferences:com.apple.preferences.sharing?Internet
Bluetooth Sharing x-apple.systempreferences:com.apple.preferences.sharing?Services_BluetoothSharing

Software update x-apple.systempreferences:com.apple.preferences.softwareupdate?client=softwareupdateapp

所有这一切都可以通过在preferencePane中输入Info.plist + System Preferences.app中的CFBundleURLTypes (CFBundleURLSchemes) x-apple.systempreferences (Info.plist)来实现

NSPrefPaneAllowsXAppleSystemPreferencesURLScheme

自 10.15 起,部分 key 位于 PrivacyTCCServices.plist (Security.prefPane) 中

自 10.14 Mojave 起,一些隐私 key 已不复存在。 Mojave 隐私列表:enter image description here

Catalina 隐私列表: enter image description here

关于Cocoa 按钮打开系统偏好设置页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6652598/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com