質問

Haven't ever scripted with apple script before was wondering if it was possible to create an applescript that could toggle the settings for messages in the notification that displays the message preview. I was then gonna use quicksilver to call that script, is this possible with applescript and would quicksilver be able to make the appropriate calls to initiate the script? I'm running mavericks OS.

役に立ちましたか?

解決

This toggles the "Show message preview" checkbox:

tell application "System Preferences"
    reveal pane id "com.apple.preference.notifications"
end tell
tell application "System Events" to tell window 1 of process "System Preferences"
    repeat with r in rows of table 1 of scroll area 1
        if name of UI element 1 of r is "Messages" then
            set selected of r to true
            exit repeat
        end if
    end repeat
    click checkbox "Show message preview" of group 1
end tell
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top