2014-07-13 74 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

謝謝您的很好的程序。它的工作原理應該如此! –

相關問題