PDA

View Full Version : Toggle Bluetooth with keyboard?




stoid
Feb 20, 2007, 06:55 PM
I have a PowerBook that I hook (in clamshell mode) to a 23" ACD at home and I use a Bluetooth mouse. To save battery in class, I turn off bluetooth since I just use the trackpad. Then, when I get home, it's a hassle to have to open up the laptop after it's plugged into monitor, firewire, usb, and everything to then have to pull it out and try to navigate up to the menu to turn bluetooth back on.

Can I set up a hot-key to turn bluettoth on, or toggle it on/off?

Thanks!



rdowns
Feb 20, 2007, 07:04 PM
Can Automator do this?

ebouwman
Feb 20, 2007, 07:05 PM
i have a the same problem:p
i'll try to see if i can find a way.

stoid
Feb 22, 2007, 08:41 AM
any ideas yet?

wwooden
Feb 22, 2007, 08:44 AM
I can't imagine that bluetooth drains battery that quickly, I would just leave it on and not worry about it. I mean, my phone has it and I never turn it off and my phone lasts a few days between charges.

ebouwman
Feb 22, 2007, 12:19 PM
I can't imagine that bluetooth drains battery that quickly, I would just leave it on and not worry about it. I mean, my phone has it and I never turn it off and my phone lasts a few days between charges.

Bluetooth does take lots of batteries, just like how the wireless does, so it is good to turn it off whenever possible.

I couldn't find any way to create a shortcut, but then again, i don't know much about making short cuts:p

There may be a way, but I don't know how

killmoms
Feb 22, 2007, 12:26 PM
Bluetooth does take lots of batteries, just like how the wireless does, so it is good to turn it off whenever possible.

I couldn't find any way to create a shortcut, but then again, i don't know much about making short cuts:p

There may be a way, but I don't know how

Actually, you're completely wrong. Bluetooth is DESIGNED to consume TINY amounts of power. That's why it's A) slow, and B) very small range. WiFi takes up a far greater amount of power than Bluetooth does. This is why Bluetooth can be used in very small devices like cell phones with little impact on battery life. I wouldn't worry about it.

lancestraz
Feb 22, 2007, 12:31 PM
I have a PowerBook that I hook (in clamshell mode) to a 23" ACD at home and I use a Bluetooth mouse. To save battery in class, I turn off bluetooth since I just use the trackpad. Then, when I get home, it's a hassle to have to open up the laptop after it's plugged into monitor, firewire, usb, and everything to then have to pull it out and try to navigate up to the menu to turn bluetooth back on.

Can I set up a hot-key to turn bluettoth on, or toggle it on/off?

Thanks!
Do you have a network in your home that you connect to?
If so, you could use this (http://osx.iusethis.com/app/homeandaway) to automatically toggle bluetooth whenever you join your home network. If we can figure out how to toggle bluetooth...

lancestraz
Feb 22, 2007, 11:32 PM
This AppleScript (http://lime.quickshareit.com/share/togglebluetooth1ec46.zip) toggles Bluetooth on/off.

If you want it to run automatically when you come home use this app (http://maccrafters.com/home_and_away/).
If you want to map it to a hotkey I recommend this app (http://www.shadowlab.org/Software/software.php?sign=Sprk&lang=2).

Just ask if you want anything changed in it.

G5Unit
Feb 22, 2007, 11:47 PM
This AppleScript (http://ugli.quickshareit.com/share/togglebluetooth56c52.zip) toggles Bluetooth on/off.

If you want it to run automatically when you come home use this app (http://maccrafters.com/home_and_away/).
If you want to map it to a hotkey I recommend this app (http://www.shadowlab.org/Software/software.php?sign=Sprk&lang=2).

Just ask if you want anything changed in it.

Yeh an AppleScript would actually be the least intrusive way of dealing with your problem.

GimmeSlack12
Feb 24, 2007, 07:45 PM
tell application "System Preferences"
activate
set current pane to pane "com.apple.preferences.Bluetooth"

tell application "System Events"
if (UI elements enabled) then
tell process "System Preferences"
try
click radio button 1 of tab group 1 of window 1
click button 1 of tab group 1 of window 1

tell application "System Preferences"
quit
end tell

return 1
on error
return 2
end try
end tell
else
return 0
end if
end tell
end tell

Here's my Applescript for Toggling Bluetooth. Works almost exactly like that Bluetooth program posted above.

I have one for Airport too if anyone wants.

ebouwman
Feb 25, 2007, 08:14 PM
i know i'm a little bit late with this BUT you can press CTRL - F8 and it brings you to the Bluetooth drop down menu then just use the arrow key and enter to disable bluetooth.

axonic labs
Mar 2, 2007, 02:45 AM
i have always wanted something like this as well since i got my powerbook a couple of years ago. i actually wrote an application to toggle bluetooth and i just recently made it available on the web. i have been using it myself for a while now and you can get it at http://www.axoniclabs.com/Bluetoggle/

enjoy :)

ebouwman
Mar 2, 2007, 12:02 PM
is there something to toggle airport?
that app works nicely, easy to install easy to set the shortcut, works perfectly.

GimmeSlack12
Mar 3, 2007, 04:14 AM
I have one for Airport too if anyone wants.


tell application "Internet Connect"
activate
tell application "System Events"

tell window 1 of process "Internet Connect"
tell button "Airport" of tool bar 1
click

end tell

if exists button "Turn AirPort On" then

tell application "Internet Connect" --brings the following dialog window to the front, allowing you to hit the return key to cancel, otherwise you'd have to click on the dialog window to bring it to the front - as I had to do in my first attempt.

end tell

tell button "Turn Airport On"
click
end tell
say "Airport, On"

else
tell application "Internet Connect" --brings the following dialog window to the front

end tell

tell button "Turn Airport Off"
click
end tell
say "Airport, Off"
end if

end tell

end tell
quit
end tell


Here is the Airport toggle code.

ebouwman
Mar 3, 2007, 01:03 PM
wouldn't that be a little slow though because from the looks of the code it seems that it has to open system prefs then close it.

lancestraz
Mar 3, 2007, 01:42 PM
wouldn't that be a little slow though because from the looks of the code it seems that it has to open system prefs then close it.
The script above doesn't do anything with System Preferences.
Do you mean "Internet Connect"?

Even though it has to open Internet Connect is is just as fast as the script below which open nothing.

This script will only work if you have the AirPort menu extra (the little icon in the menu bar that tells you your signal strength) enabled.

tell application "System Events" to tell the front menu bar of process "SystemUIServer"
set menu_extras to value of attribute "AXDescription" of menu bar items
repeat with i from 1 to the length of menu_extras
if item i of menu_extras is "airport menu extra" then
set airport_extra to i
exit repeat
end if
end repeat
tell menu bar item airport_extra
click
tell 2nd menu item of front menu
click
end tell
end tell
end tell

Eraserhead
Mar 3, 2007, 01:45 PM
I can't imagine that bluetooth drains battery that quickly, I would just leave it on and not worry about it.

I think I switched bluetooth off once on my Macbook and I got an extra minute of battery life out of 3 hours. Switching airport off added about 5 minutes

ebouwman
Mar 3, 2007, 02:10 PM
I think I switched bluetooth off once on my Macbook and I got an extra minute of battery life out of 3 hours. Switching airport off added about 5 minutes

i usually get a lot more than 5 minutes extra for switching off wireless, it probably has to do with the fact that my computer would allways be looking for a network to connect to, then if it does find one it has to stay connected, also running apps like MSN or iChat are allways using the internet.