我想创建一个键盘快捷键/触控板手势来: - 首先显示 Yosemite 的通知中心 - 然后每次调用相应的脚本时来回切换“今天”和“通知”窗格
我在博客上找到了以下两个苹果脚本,用于在 Yosemite 的通知中心显示“今日”和“通知”窗格
今天:
tell application "System Events" to tell process "SystemUIServer"
click menu bar item "Notification Center" of menu bar 2
end tell
tell application "System Events" to tell process "NotificationCenter"
click radio button "Today" of radio group 1 of window "NotificationTableWindow"
end tell
通知:
tell application "System Events" to tell process "SystemUIServer"
click menu bar item "Notification Center" of menu bar 2
end tell
tell application "System Events" to tell process "NotificationCenter"
click radio button "Notifications" of radio group 1 of window "NotificationTableWindow"
end tell
所以我想要做的是以以下方式“合并”这两个脚本
If "Notification Center" is [hidden]
Then
Display "Notification Center"
Else
If "Today" pane is displayed
then display "Notifications" (first script above)
else display "Today" (second script)
End If
end if
几乎成功了,但我尝试了不同的方法来“读取”窗口“NotificationTableWindow”的单选组 1 的值来定义当前显示的窗格,但没有任何效果
感谢您的支持