Interacting with Bluetooth Devices GUI

Hello,

I am trying to write a script to disconnect my bluetooth mouse. This can be done throught the devices tab in the bluetooth system preferences pane.

I used UI Element Inspector and UI Browser to try to get Applescript to select the device from the list of paired devices and then click the “Disconnect” button. I can have it get to the devices tab no problem, and I can have it disconnect when the appropriate device is selected in the list, but I can’t get Applescript to select the device itself. Here’s what I have:

	tell application "System Preferences"
	activate
	set current pane to pane "Bluetooth"
	tell application "System Events" to tell window "Bluetooth" of process "System Preferences"
		click radio button "Devices" of tab group 1
	end tell
	
	tell application "System Events" to tell window "Bluetooth" of process "System Preferences"
		click static text 1 of list 1 of scroll area 1 of scroll area 1 of browser 1 of splitter group 1 of tab group 1
	end tell

Any ideas?

Thanks.