Bluetooth “如何打开蓝牙”;“编辑串行端口”;在OSX上使用Applescript?
我试图在OSX 7上编写一个applescript,它只需打开蓝牙首选项菜单中的“编辑串行端口”选项(我只有一个配对设备)。我可以一直访问bluetooth preferences(蓝牙首选项)窗格,但我一直在想如何让applescript从下拉菜单中选择合适的选项。有人能帮我吗 到目前为止,applescript:Bluetooth “如何打开蓝牙”;“编辑串行端口”;在OSX上使用Applescript?,bluetooth,serial-port,applescript,osx-lion,Bluetooth,Serial Port,Applescript,Osx Lion,我试图在OSX 7上编写一个applescript,它只需打开蓝牙首选项菜单中的“编辑串行端口”选项(我只有一个配对设备)。我可以一直访问bluetooth preferences(蓝牙首选项)窗格,但我一直在想如何让applescript从下拉菜单中选择合适的选项。有人能帮我吗 到目前为止,applescript: tell application "System Preferences" activate end tell tell application "System Pref
tell application "System Preferences"
activate
end tell
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.Bluetooth"
end tell
非常感谢您分享您的知识和专业技能 我能够回答自己的问题,并在这个过程中学习了很多关于applescript和xcode的知识。正确的脚本如下所示:
tell application "System Preferences"
set current pane to pane id "com.apple.preferences.bluetooth"
tell application "System Events"
tell process "System Preferences"
click menu button "Perform tasks with the selected device" of splitter group 1 of group 1 of window "Bluetooth"
delay 1 -- give menu time to pop up
click menu item "Edit Serial Ports…" of menu 1 of menu button "Perform tasks with the selected device" of splitter group 1 of group 1 of window "Bluetooth"
delay 5
end tell
end tell
quit
end tell