3
A
回答
5
您可以使用OS X私有API IOBluetoothPreferenceSetDiscoverableState。
// Declaration of private API
void IOBluetoothPreferenceSetDiscoverableState(int discoverable);
int IOBluetoothPreferenceGetDiscoverableState();
// Usage
// Turn on Discoverability
IOBluetoothPreferenceSetDiscoverableState(1);
// Get current discoverable state
IOBluetoothPreferenceGetDiscoverableState()
您可能還會發現這些API用於打開和關閉藍牙有用:
void IOBluetoothPreferenceSetControllerPowerState(int powered);
int IOBluetoothPreferenceGetControllerPowerState();
1
告訴應用程序 「系統偏好設置」
set current pane to pane "com.apple.preferences.Bluetooth"
tell application "System Events"
tell process "System Preferences"
set isOnCheckbox to checkbox "On" of window "Bluetooth"
if value of isOnCheckbox is 0 then
click isOnCheckbox
end if
end tell
end tell
quit
末告訴
這個蘋果腳本將開啓/關閉藍牙visibility.Hope這將幫助。
相關問題
- 1. Mac OS X /藍牙:以編程方式禁用簡單配對?
- 2. 如何以編程方式配對藍牙設備在Android
- 3. 將藍牙設置爲可發現模式
- 4. 是否可以在Android上以編程方式關閉藍牙發現功能?
- 5. 爲藍牙設置可發現模式,以始終在接縫上失敗
- 6. 如何以編程方式配對藍牙設備Android
- 7. 以編程方式打開藍牙
- 8. Android以編程方式藍牙配對
- 9. 如何以編程方式在WM中「通過藍牙連接」?
- 10. 如何在android中以編程方式激活藍牙
- 11. 如何以編程方式打開iOS 10中的藍牙設置
- 12. 禁用藍牙發現模式在Android
- 13. Mac OS X藍牙編程示例?
- 14. 是否可以通過編程方式爲藍牙配對設置引腳?
- 15. OS X上的Objective-C:以編程方式設置插座
- 16. 以編程方式設置OS X Lion全屏桌面圖像
- 17. 如何在android中以編程方式自動連接到藍牙設備?
- 18. 如何在iOS7中以編程方式獲取iPhone設備的藍牙地址
- 19. Qt + OS X +藍牙
- 20. 以編程方式在OS X中模擬鼠標輸入
- 21. 以編程方式使用藍牙連接兩個Android設備
- 22. 以編程方式連接到藍牙設備目標c
- 23. 以編程方式連接到藍牙設備
- 24. Android +以編程方式通過藍牙連接設備
- 25. 以編程方式將WP8設備連接到藍牙耳機
- 26. 通過藍牙以編程方式連接兩個Android設備
- 27. Android - 通過藍牙以編程方式發送圖像
- 28. 以編程方式啓用/禁用藍牙配置文件
- 29. 如何以編程方式確定藍牙主/從角色?
- 30. 如何以編程方式更改藍牙參數iPhone?