2011-09-21 4 views

답변

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

TELL 응용 프로그램 "시스템 환경 설정"

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를 ON/OFF 스위치 것

이 애플 스크립트를 말한다.

관련 문제