-
-
Save kumekay/c91c8b6e0907f140454b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Bluetooth for VirtualBox | |
--delay 5 | |
set question to display dialog "Manage Bluetooth for ... " buttons {"VirtualBox", "Cancel", "Mac OS"} default button "Cancel" cancel button "Cancel" with icon caution with title "Bluetooth" giving up after 30 | |
set answer to button returned of question | |
if answer is equal to "VirtualBox" then | |
-- delay 30 | |
try | |
do shell script "launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist" | |
delay 5 | |
end try | |
try | |
do shell script "sudo kextunload -b com.apple.driver.BroadcomUSBBluetoothHCIController" password "secretols" with administrator privileges | |
delay 5 | |
end try | |
try | |
do shell script "sudo kextunload -b com.apple.driver.AppleUSBBluetoothHCIController" password "secretols" with administrator privileges | |
delay 5 | |
end try | |
try | |
do shell script "sudo kextunload -b com.apple.iokit.IOBluetoothSerialManager" password "secretols" with administrator privileges | |
end try | |
else if answer is equal to "Mac OS" then | |
-- delay 30 | |
try | |
do shell script "sudo kextload -b com.apple.iokit.IOBluetoothSerialManager" password "secretols" with administrator privileges | |
delay 5 | |
end try | |
try | |
do shell script "sudo kextload -b com.apple.driver.AppleUSBBluetoothHCIController" password "secretols" with administrator privileges | |
delay 5 | |
end try | |
try | |
do shell script "sudo kextload -b com.apple.driver.BroadcomUSBBluetoothHCIController" password "secretols" with administrator privileges | |
delay 5 | |
end try | |
try | |
do shell script "launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist" | |
end try | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment