Toggle “Illuminate keyboard” without using private APIs
-
28-10-2019 - |
题
Is there a way to turn on and off the "Illuminate keyboard" setting programmatically, without using private APIs?
I need to do it in a way that will be accepted by the Mac App Store.
解决方案
You can try to use the ScriptingBridge framework; it works by sending Apple events. The System Preferences application exposes ScriptingBridge bindings so you can access it.
Here some starting points:
If you go with ScriptingBridge and want to submit your application the Mac App Store, then you have to request a temporary exception entitlement to allow your application to send Apple events; check the Entitlement Key Reference to learn more about it.
不隶属于 StackOverflow