编程键盘快捷方式添加到Mac系统preferences [英] Programmatically add keyboard shortcut to Mac System Preferences

查看:341
本文介绍了编程键盘快捷方式添加到Mac系统preferences的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我去系统preferences,键盘,键盘快捷键,然后应用程序快捷方式,我可以定义自定义快捷键在Mac上使用。

If I go to System Preferences, Keyboard, Keyboard Shortcuts, then Application Shortcuts, I can define custom shortcuts to be used on a Mac.

任何方式通过AppleScript的访问此功能?

Any way to access this functionality via Applescript?

推荐答案

快捷方式存储在NSUserKeyEquivalents词典在〜/库/ preferences /。全球preferences.plist和应用程序的属性列表。

The shortcuts are stored in NSUserKeyEquivalents dictionaries in ~/Library/Preferences/.GlobalPreferences.plist and the property lists of applications.

defaults write -g NSUserKeyEquivalents -dict-add Duplicate '~@d' Minimize '\0'
defaults write com.apple.finder NSUserKeyEquivalents '{"Show Package Contents"="@\r";}'

快捷方式格式在 Cocoa文字系统一文中描述。

这篇关于编程键盘快捷方式添加到Mac系统preferences的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆