使用AppleScript更改系统偏好设置而看不到? [英] Use AppleScript to change System Preferences without being visible?

查看:81
本文介绍了使用AppleScript更改系统偏好设置而看不到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在系统偏好设置"中更改设置,而用户不会看到发生的事情.
如果我有一个像这样开始的脚本:

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更改系统偏好设置而看不到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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