2014-07-13 77 views
0
tell application "System Preferences" to activate 
delay 0 

tell application "System Events" 
    tell process "System Preferences" 
     click the menu item "Universal Access" of the menu "View" of menu bar 1 
     click the radio button "Seeing" of the first tab group of window "Universal Access" 
     click the checkbox "Use grayscale" of tab group 1 of window "Universal Access" 
    end tell 
end tell 
tell application "System Preferences" to quit 

我曾经能够使用上面的Applescript,它会导致屏幕灰度化,直到更新到Maverick。但是它不适用于发生在error "System Events got an error: Can’t get menu item \"Universal Access\" of menu \"View\" of menu bar 1 of process \"System Preferences\"." number -1728 from menu item "Universal Access" of menu "View" of menu bar 1 of process "System Preferences"的Maverick。有人知道哪些部分需要改变与Maverick合作?转换AppleScript在Lion上运行良好,但不在Maverick中

回答

1

的变化是窗格的名称,窗口的名称,没有单选按钮和选项卡组1

试试这个脚本:

tell application "System Preferences" 
    launch 
    reveal anchor "Seeing_Display" of pane id "com.apple.preference.universalaccess" 
end tell 
tell application "System Events" 
    click checkbox "Use grayscale" of window "Accessibility" of process "System Preferences" 
end tell 
quit application "System Preferences" 
+0

谢谢您的很好的程序。它的工作原理应该如此! –

相关问题