setDeviceNameto"xiaodu-A9-9191"tellapplication"System Events"totellprocess"SystemUIServer"setbtto(firstmenubaritemwhosedescriptionis"bluetooth")ofmenubar1clickbtifexistsmenuitemDeviceNameofmenuofbtthentell(firstmenuitemwhosetitleisDeviceName)ofmenuofbtclicktellmenu1ifexistsmenuitem"连接"thenclickmenuitem"连接"return"Connecting..."elsekey code53-- hit Escape to close BT menureturn"No connect button; is it already connected?"endifendtellendtellelsekey code53-- hit Escape to close BT menureturn"Cannot find that device, check the name"endifendtell