--
You received this message because you are subscribed to the Google Groups "Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blacktree-quicks...@googlegroups.com.
To post to this group, send email to blacktree-...@googlegroups.com.
Visit this group at http://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "Quicksilver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blacktree-quicksilver/dzPo4KBXpH4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to blacktree-quicks...@googlegroups.com.
In the mean time I'll be casually searching for ways to make this script neater and hopefully connect to bluetooth devices via the command line just like the blueutil utility.
tell application "System Events" to tell process "SystemUIServer"
set {x, y} to paragraphs of (do shell script "MouseTools -location")
tell (first menu bar item of menu bar 1 whose value of attribute "AXDescription" is "bluetooth")
click
if exists menu item "Bluetooth: Off" of first menu then
click menu item "Turn Bluetooth On" of first menu
delay 0.5
click
set {m, n} to position of menu item "MyPhone" of first menu
do shell script "MouseTools -x " & (m + 10) & " -y " & (n + 10)
delay 0.1
do shell script "MouseTools -x " & (m - 10) & " -y " & (n + 10)
click menu item "Connect to Network" of first menu of menu item "db" of first menu
--do shell script "MouseTools -x " & (m - 10) & " -y " & (n + 10) & " -leftClick"
else
click menu item "Turn Bluetooth Off" of first menu
end if
end tell
do shell script "MouseTools -x " & x & " -y " & y
end tell