I'm not a programmer, first off. So forgive my ignorance here. I am trying to disable bluetooth using applescript. My goal is to assign this applescript to my Griffin Powermate button to make it easier to use my iMac as a second screen for my MBP. I have this script, which gets it most of the way, but the problem is in mavericks, if you click the button to turn off bluetooth, you get another window that needs you to confirm that you want to do that. In comes in the form of two buttons, one that says "Turn bluetooth off" and the other that says "Leave bluetooth on".
So I can't for the life of me figure out how to get the script to click the button in the secondary window (like a popup, but it's not modal)
Thoughts?
Here's the current script I have, which works great to turn bluetooth back on, by the way, because there is no secondary window.
Thanks so much for your help.
So I can't for the life of me figure out how to get the script to click the button in the secondary window (like a popup, but it's not modal)
Thoughts?
Here's the current script I have, which works great to turn bluetooth back on, by the way, because there is no secondary window.
Code:
tell application "System Preferences"
reveal pane "com.apple.preferences.Bluetooth"
end tell
tell application "System Events" to tell process "System Preferences"
click button 6 of window 1
end tell
quit application "System Preferences"
Thanks so much for your help.
Attachments
Last edited by a moderator: