AppleScript to turn off Bluetooth after an hour of no usage

I'm interested in making an AppleScript that will turn off Bluetooth after a bluetooth device is not used for (let's say) one hour. The script should run only on battery life, not when the computer is plugged in.
Any ideas on how to start? Thanks.

I don't think there's any way (at least easy way) to do this.
AppleScript is very good at initiating events, but not good at responding to them. As such it's not easy to write a script in this manner. About the only way to do this would be to have a stay-open script that periodically checks the list of connected devices and keeps track of when the last bluetooth device was used - however, there's a big difference between being 'used' and being 'connected'... you may have a bluetooth headset 'connected', but if you're not running any audio apps it might not be used, and that's hard to AppleScript to determine.

Similar Messages

  • My wifi wasn't working for more than 10 minutes at a time after updating to IOS8 and resetting network settings. I turned off google drive, turned off Bluetooth, reset network settings and rebooted my iPad4. So far so good.

    I have an ipad4.  Wifi keeps cutting out after the upgrade even after I forget the network and resign on or reset all network settings. I deleted iCloud drive from my iPad, turned off Bluetooth, reset network settings, and rebooted my iPad. Since I upgraded to IOS8 this is the longest wifi has consistently been working for me. Which is approximately an hour now. Anyone else find that this worked or have figured out if this or anything out there is a permanent fix?

    Hi CollinGCC78,
    It sounds like you have been on the right track in troubleshooting this issue. If you are still having issues, you may want to double-check the steps outlined in the following article, in order if possible (apologies for replicating any steps you have already taken):
    iOS: Troubleshooting Wi-Fi networks and connections
    Regards,
    - Brenden

  • TS1630 I can't get my music to play all of sudden. It happened after I paired the audio with my Maxima. I turned off bluetooth and it still would not play

    I can't get my music to play all of sudden. It happened after I paired the audio with my Maxima. I turned off bluetooth and it still would not play

    I tried the hard start and still the same! If I go under artist
    I can get it to start playing one song. Then if I try shuffle
    Nothing !! Then I can't get it to play anymore.
    Very annoying

  • HT1476 Hi, I have an iPhone 4s running iOS 7.0.4 and the phone keeps going of whenver battery level drops to 20% and it give the warning. It turns off immediately after I dismiss the warning message. I LOCKED THE PHONE AT 21% and I was able to play music

    Hi, I have an iPhone 4s running iOS 7.0.4 and the phone keeps going of whenver battery level drops to 20% and it give the warning. It turns off immediately after I dismiss the warning message. I LOCKED THE PHONE AT 21% and I was able to play music to 4% which means there is no problem with the battery, this seems to be a programming error.
    Earlier suggestion include that the battery has a dead cell but it wouldnt keep playing music for over 2 hours it it had a dead cell.

    My issue with IOS 7.1 and higher is my Bluetooth for the phone still works...no problem but the music does not work with bluetooth...I have an Acura TSX 2010...Acura said there are no incidents reported, but me...I just upgraded to IPhone 6 and still no good....as soon as i hit the AUX button it say USB...not bluetooth...ugh

  • [SOLVED] Don't have permission to turn off bluetooth, even with sudo!

    I never use bluetooth on my laptop, but every time I boot arch the radio and light are both on. I tried unloading the bluetooth module, using bluez and other tools to shut off bluetooth, etc., but that radio just stays on. After searching the web for a while, I finally found the solution: cut off power to the device. I can do that with this command:
    echo "0" > /sys/devices/platform/sony-laptop/bluetoothpower
    And turn it back on by changing "0" to "255". The only problem is, I can't run this as a normal user, and I can't even run it with sudo! Here is the output:
    $ echo "0" > /sys/devices/platform/sony-laptop/bluetoothpower
    zsh: permission denied: /sys/devices/platform/sony-laptop/bluetoothpower
    $ sudo echo "0" > /sys/devices/platform/sony-laptop/bluetoothpower
    zsh: permission denied: /sys/devices/platform/sony-laptop/bluetoothpower
    (I'm using zsh but this also happens with bash)
    However, I can su to root and run this command successfully
    $ su
    Password:
    # echo "0" > /sys/devices/platform/sony-laptop/bluetoothpower
    And off goes the light. I would like to somehow turn off bluetooth at boot, but I don't know how to have Arch run a command as the root user at boot after loading the modules (to ensure the bluetooth radio is not started up again). It seems that bluetoothpower is created at each boot, because I tried changing the permissions to read & write for all, then adding the command to my .xinitrc. This worked, but only during that session. After rebooting I had the same problem.
    Help?
    Last edited by Allamgir (2009-07-29 13:44:40)

    Yes! Yet again the wiki has saved me! I followed this part: http://wiki.archlinux.org/index.php/Pm- … _own_hooks
    I just set it to turn off bluetooth upon resume, and it works! yay!
    Thanks everyone!

  • I accidentally turned off bluetooth and now my keyboard won't connect. I already tried to reboot the computer. I can't use the mouse because I ca't get past the user log-in screen. Please help

    I accidentally turned off bluetooth and now my keyboard won't connect. I already tried to reboot the computer. I can't use the mouse because I ca't get past the user log-in screen. Please help

    http://www.cultofmac.com/247979/whoops-reconnect-your-bluetooth-keyboard-and-mac -after-logging-out-os-x-tips/
    had the same problem and it worked!

  • Hciconfig crashes when turning off bluetooth

    Hi there.
    I'm having an issue with hciconfig / bluetooth on my Lenovo X220. Whenever I turn off bluetooth (using laptop-mode, gnome3 bluetooth menu or hciconfig) while my bluetooth mouse is connected, i'll end up getting the following messages:
    http://pastebin.com/ggj5fWqC
    Bluetooth becomes unusable after that, laptop-mode-tools does not switch modes anymore, can't unload / reload thinkpad_acpi, sometimes the system freezes completely.
    This error occurres on two independent archlinux installations on my laptop, one of those is a minimal rescue system.
    Any suggestions on how to approach / fix this issue?
    Last edited by opticldelusion (2012-04-22 12:45:44)

    Hi Barry,
    I have reset SMC and PRAM, but the problem remains. With my mouse synchronised, if I turn bluetooth off the systems crashes right away...

  • Turn Off Bluetooth + Battery Life

    Hey Everyone,
    I am using XP Pro under bootcamp on a Macbook Aluminum 2.0 Ghz. I was wondering if there was a way to turn off bluetooth. Also, there is a major difference in battery life between Windows and OS X. In OS X I get about 4 - 5 Hours. Whereas when I'm in XP I get about 2 - 3 Hours. Is this normal?
    Thanks.

    Hi,
    the differences in battery life between OSX and Windows are 'normal' !
    The Apple Drivers for Windows lack the special energy savings feature that Apple has implemented with OSX.
    To my knowledge the only way to turn of bluetooth in Windows is to use the Device Manager (Control Panel - System - Hardware) and deactivate the bluetooth device.
    Regards
    Stefan

  • Cannot turn off Bluetooth on B series (B320 i5)

    Whenever the computer starts, the Bluetooth light will be turned on. Although I have removed all Bluetooth related applications and there is no Bluetooth device shown on Computer Device list.
    I have checked BIOS. There is no way to turn-off, too.
    Is there any way to turn-off Bluetooth light?
    It is esstential that if the Bluetooth and Wifi lights are turned-on, my computer will be hanged very frequently even I restore from the original factory image.
    Please advise what I can do. Thanks.

    You may disable the Bluetooth device from the Device Manager if it helps you.
    To uninstall the Bluetooth driver, you need uninstall it from the device manager and if prompts to delete installation folder please proceed.
    After this please go to Control Panel and check for Bluetooth software, if it is there then uninstall it.
    Please check this if it resolve the issue for you.
    Best Regard,
    Tanuj
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution".! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Ugh! How to navigate when you have a dead Mouse / Trackpad or accidentally turned off bluetooth

    Wow...
    Did a stupid thing and turned off bluetooth on my Mac and watched as my Apple Magic Mouse and Apple Magic Trackpad dissapeared and left me stranded.
    For those of you dead in the water unable to navigate your Mac here are some tips:
    Reboot your Mac and Zap your PRAM which will force the Mac to turn on bluetooth again.  Shut down the computer by holding the power button.  Hold down Command (the Apple icon 4 leaf clover key), Option, P and R keys together and hold them all down after you turn on the Mac.  If you do this before the grey screen you'll see the Mac chime and restart.  You can now let go of your keys and see if BlueTooth can now discover your devices.
    If you haven't already swapped out batteries in your Mouse, Keyboard or Trackpad please do so.  Be sure to not mix batteries of different types in the device.
    If you have keyboard access, but not your mouse or trackpad you can press the Option Key 5 times and then your numeric pad should move the mouse allowing you to navigate to things like System Preferences, Bluetooth to turn it back on!
    If you have a USB mouse you can plug it in, navigate your mac and turn bluetooth back on.
    If you have Apple Screen Share or Apple Remote Access you can use another Mac to log into your Mac and turn on bluetooth.
    Serious Accessbility Feature Requests for Apple (and yes I know this isn't the forum or place to put this, but it needs to be said):
    You need to go back and fix 10.8.4 to allow complete navigation of a Mac with a keyboard only.  You can use Command + SpaceBar and type System Preferences and then type BlueTooth, but once you are in the Bluetooth settings you can't use your keyboard to navigate to the ON option.
    You can't also navigate into System Preferences / Accessibility to turn Enable Mouse Keys (you need a mouse to turn this option on!).  The Mouse & Trackpad options should be made so that a keyboard could turn on/off this feature, because a lot of people trying to turn on this feature are folks like me who lost mouse/trackpad access!!
    Hopefully this helps others!  Hopefully Apple will do some basic UI improvements to bring back OS navigation for users who only have access to a keyboard or just a mouse/trackpad (no physical keyboard).  These kinds of tests should be part of every major OS release!

    http://apple.com/feedback/macosx.html

  • My macbook pro keyboard backlight won't turn off, even after pressing F5

    my macbook pro keyboard backlight won't turn off, even after pressing F5

    Try resetting the  SMC http://support.apple.com/kb/ht3964

  • How to turn off Bluetooth adapter via command line or script?

    I'm trying to write a batch script that will be able to turn on/off any connected Bluetooth adapters.
    In the "Bluetooth Settings" window, how can I change the "Turn off Bluetooth adapter" setting via command line or script?
    Due to my account not being verified yet, I cannot post a screenshot.  I will update this thread as soon as my account is verified.

    get-service -DisplayName 'Bluetooth Support Service' | Stop-Service
    ¯\_(ツ)_/¯

  • My iPhone 4 turns off (crashes) after accesing any apps, It work fine when plugged to charger. I tried all troubleshooting steps suggested by Apple but it doesn't work. What could be the problem and what are the solutions?

    My iPhone 4 turns off (crashes) after accesing any apps, It work fine when plugged to charger (power supply). I tried all troubleshooting steps suggested by Apple but it doesn't work. I backed up my phone. I restored it several times. Even I re-installed iphone software. Also I restored it as a new iphone but doesn't work. What could be the problem and what are the availble solutions?

    We can't know if there's a "fixture" because we can't examine your phone.  But Apple can.  Make a Genius Bar appointment and get your phone evaluated.

  • How to completely turn off Bluetooth and Wireless

    Hey everybody,
    I'm running Windows XP SP3 via Boot Camp and I was wondering if anyone can assist me in how to completely turn off Bluetooth and Wireless connectivity so that I can reserve as much batter life while being in class taking notes without a plug-in source, but not uninstall. I know there is a Bluetooth control panel and I disabled it there but under "connect to" its still remains there. Basically I want to have the Bluetooth and Wireless turned off completely when I startup and still have the icons shown in the taskbar to let me know that they are still there.
    Thanks!

    Joergen Thomson, I can see that you have the same thoughts like I do, I wish they could release a software that is stable and better then this.
    I dont have the energi or time to report all flaus back to cisco, this product have taking to much of my time and frustration already. Thank you so much for all the time you spend to try get this product stable and hopefully a good product.
    I have a costumer that have a webservice that is IP restricted, For now I have to define more then 93 policys openening for the same service because this doesnt handle address list and groups. And all the times I had to set it back to factory default becasue of HTTP Admin server stopped, VPN Problem, Firmware Upgrades, "Packet Loss" and so on takes alot of time becasue I need to reconfig policies back.
    For now to they release a firmware is stable I have take this piece off the network and put the back a old Fortinet 60 box.

  • My iphone 4 turns off automatically after screen lock

    Hello guys,
    my iphone 4 turns off automatically after screen lock, i have to press the POWER + HOME button during 10 secondes for reboot.
    And it's like that every time i lock the screen.
    Please can someone help me ?
    thanks.

    Standard troubleshooting steps are reset, restore, restore as new.
    Since resetting isn't working, try backing up and restoring through iTunes.

Maybe you are looking for