- 积分
- 1724
- 最后登录
- 2024-4-21
- 精华
- 0
- 阅读权限
- 220
- 主题
- 275
- UID
- 3262704
- 帖子
- 2540
- PB币
- 13766
- 威望
- 118
- 贡献
- 0
- 技术
- 24
- 活跃
- 6621
- UID
- 3262704
- 帖子
- 2540
- PB币
- 13766
- 贡献
- 0
- 技术
- 24
- 活跃
- 6621
|
剁手扫地机器人送了一个天猫精灵,拿来做电脑音箱了,之前苦恼的是在win下连接完之后回到mac需要移除再连一次比较麻烦,后面通过hackintool导出蓝牙注册表,在win下解决了问题,不过还是有点不爽,win下音箱在启动的时候会自动连接,mac每次都需要手动连接一次,想起手机上的“捷径”能帮我们做一些自动化的事情,一搜mac上果然也差不多。开整1、打开“自动操作”
2、新建文稿
3、选择“应用程序”
4、双击选择“运行appleScript“
- set DeviceName to "你的设备名称"
- tell application "System Events" to tell process "SystemUIServer"
- set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
- click bt
- if exists menu item DeviceName of menu of bt then
- tell (first menu item whose title is DeviceName) of menu of bt
- click
- tell menu 1
- if exists menu item "连接" then
- click menu item "连接"
- return "Connected"
- else
- key code 53 -- hit Escape to close BT menu
- return "No connect button; is it already connected?"
- end if
- end tell
- end tell
- else
- key code 53 -- hit Escape to close BT menu
- return "Cannot find that device, check the name"
- end if
- end tell
复制代码
5、复制代码 你的设备名称请务必一字不差
6、命名保存、将应用程序添加为“登陆项”
建议保存前通过“脚本编辑器”先测试一下
7、收工
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|