tell the application "system events"
Click the "Disable Bluetooth" button in Window 1 of the "System Preferences" application process.
I receive the error:
error "System events had an error: could not get the request process " System Preferences "." Issue -1728 of the application process "System Preferences"
I have also tried
tell the application "System Preferences"
reveal the "com.apple.preferences.Bluetooth" pane
Tell the "System Events" application to indicate to the "System Preferences" process
click on button 6 of window 1
leave the application "System Preferences"
Did not give me any mistakes, but it did not work
I am under macOS Sierra. This is supposed to disable my bluetooth (I plan to launch it when I connect)