tell application "System Preferences" -- 进入系统面板
set the current pane to pane id "com.apple.preferences.Bluetooth" -- 设置当前tab为蓝牙
tell application "System Events" -- 触发系统事件
tell process "System Preferences" -- 进入系统面板程序
tell window "Bluetooth" -- 找到蓝牙窗口
tell button 3 -- button 3是开启/关闭蓝牙按钮
click -- 点击
end tell
end tell
end tell
quit
end tell
end tell
同时,配合上Automator,制作成一个action,再为这个action添加一个快捷键