Toggle Bluetooth with keyboard?

Discussion in 'macOS' started by stoid, Feb 20, 2007.

  1. stoid macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
    #1
    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!
     
  2. rdowns Suspended

    rdowns

    Joined:
    Jul 11, 2003
  3. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #3
    i have a the same problem:p
    i'll try to see if i can find a way.
     
  4. stoid thread starter macrumors 601

    stoid

    Joined:
    Feb 17, 2002
    Location:
    So long, and thanks for all the fish!
  5. wwooden macrumors 68000

    wwooden

    Joined:
    Jul 26, 2004
    Location:
    Burlington, VT
    #5
    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.
     
  6. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #6
    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
     
  7. killmoms macrumors 68040

    killmoms

    Joined:
    Jun 23, 2003
    Location:
    Washington, DC
    #7
    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.
     
  8. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #8
    Do you have a network in your home that you connect to?
    If so, you could use this to automatically toggle bluetooth whenever you join your home network. If we can figure out how to toggle bluetooth...
     
  9. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #9
    This AppleScript toggles Bluetooth on/off.

    If you want it to run automatically when you come home use this app.
    If you want to map it to a hotkey I recommend this app.

    Just ask if you want anything changed in it.
     
  10. G5Unit macrumors 68020

    G5Unit

    Joined:
    Apr 3, 2005
    Location:
    I'm calling the cops
    #10
    Yeh an AppleScript would actually be the least intrusive way of dealing with your problem.
     
  11. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #11
    Code:
    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.
     
  12. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #12
    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.
     
  13. axonic labs macrumors member

    axonic labs

    Joined:
    Feb 28, 2007
    #13
    Bluetoggle

    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 :)
     
  14. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #14
    is there something to toggle airport?
    that app works nicely, easy to install easy to set the shortcut, works perfectly.
     
  15. GimmeSlack12 macrumors 603

    GimmeSlack12

    Joined:
    Apr 29, 2005
    Location:
    San Francisco
    #15
    Code:
    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.
     
  16. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #16
    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.
     
  17. lancestraz macrumors 6502a

    lancestraz

    Joined:
    Nov 27, 2005
    Location:
    RI
    #17
    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.

    Code:
    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
     
  18. Eraserhead macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #18
    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
     
  19. ebouwman macrumors 6502a

    Joined:
    Jan 5, 2007
    Location:
    Canada
    #19
    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.
     

Share This Page