0
我需要能够通过Keymando强制“检测显示器”。我没有看到关于如何执行系统命令的任何示例。有关如何做到这一点的任何想法?如何在keymando中执行系统命令
我需要能够通过Keymando强制“检测显示器”。我没有看到关于如何执行系统命令的任何示例。有关如何做到这一点的任何想法?如何在keymando中执行系统命令
感谢凯文,这article我得到这个使用这个脚本的工作。希望这有助于未来的人。
# Detect Displays
map "<Cmd-Ctrl-d>" do
`osascript -e '
tell application "System Preferences" to activate
tell application "System Events"
tell process "System Preferences"
click menu item "Displays" of menu "View" of menu bar 1
tell button "Detect Displays" of window 1 to click
end tell
end tell
tell application "System Preferences" to quit
'`
end
你可以像使用反引号或system()一样在ruby中做同样的事情。
例如:
map "<Ctrl-u>" do
`osascript -e 'set volume output volume (output volume of (get volume settings) + 7)'`
end
感谢您的'osascript提示凯文是强大的 – Adam 2012-07-18 06:13:38