Applescript 自动机偏好

Applescript 自动机偏好,applescript,automator,Applescript,Automator,我使用的是Lion OSX,我想做一个自动服务来切换滚动方向首选项。 因为我还使用了Wacom平板电脑,滚动方向会影响我的平移,所以我想创建一个通过按键切换的Automator服务。然而“WatchMeDoIt”要花很长时间才能正常工作,你是如何做到这一点的(applescript?还是什么?) 非常感谢你的帮助 on run {} --put whatever is appropriate here tell application "System Preferences"

我使用的是Lion OSX,我想做一个自动服务来切换滚动方向首选项。 因为我还使用了Wacom平板电脑,滚动方向会影响我的平移,所以我想创建一个通过按键切换的Automator服务。然而“WatchMeDoIt”要花很长时间才能正常工作,你是如何做到这一点的(applescript?还是什么?)

非常感谢你的帮助

on run {} --put whatever is appropriate here
    tell application "System Preferences"
        activate
        set current pane to pane "com.apple.preference.trackpad"
    end tell

    tell application "System Events"
        tell process "System Preferences"
           click radio button "Scroll & Zoom" of tab group 1 of window "Trackpad"
           click checkbox 1 of tab group 1 of window "Trackpad"
       end tell
    end tell

    tell application "System Preferences" to quit
end run
这应该可以做到。:)