我想在Mac OS Sierra中打开一个新的桌面/空间。对于Alfred Workflow。
我尝试使用我在此处找到的Applescript代码段: Automator + Applescript how to: new Desktop (open Calendar and Reminders in it)
但是这个似乎不适用于Mac OS Sierra。
我打开了辅助功能检查器,发现有两个新组。 https://i.imgur.com/PwlWvmz.png
所以我尝试了这个:
tell process "Dock" to tell group 1 to tell group 1 to tell group 1 to tell button 1 to click`
end tell
但它没有点击按钮。也许有人能够帮助我。
答案 0 :(得分:1)
我设法用以下脚本解决它
tell application "System Events" to click (every button whose value of
attribute "AXDescription" is "add desktop") of group "Spaces Bar" of
group 1 of group "Mission Control" of process "Dock"