问题描述
我想在系统偏好设置"中更改设置,而用户不会看到发生的事情.
如果我有一个像这样开始的脚本:
I would like to change settings in System Preferences without the user seeing things happen.
If I have a script that starts like:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
系统偏好设置窗口将显示给用户.
我想知道是否可以通过某种方式在后台执行此操作,或者至少将窗口最小化.
the System Preference window will be shown to the user.
I'd like to know if there is a way to do it in the background somehow, or at least keep the window minimized.
(Example script can be found in this question.)
推荐答案
您也许可以使用命令行应用程序默认值,还有一些其他命令行应用程序也可以操纵其他系统内容,例如 pmset
You might be able to do what you want with with the command line app defaults, there are some other command line apps that can manipulate other system stuff also like, pmset
也可以使用脚本添加项来设置某些内容,例如,可以使用标准添加项来设置系统容量,您还可以找到其他脚本添加项来添加更多内容.
Some things can be set using scripting additions also, for example the systems volumn can be set using the standard additions, you also you may be able to find other scripting additions to add more stuff.
这篇关于使用AppleScript更改系统偏好设置而看不到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!