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