How do I automatically log the battery percentage and time on my Retina Macbook Pro to an excel spreadsheet? (OSX 10.9.4)

Hello! So I own a 13" rMBP, and I'm running OSX 10.9.4.
How do I log my battery percentage with the date, probably down to the hour, preferably to an Excel file?
I want to track the rate at which my battery discharges, so that in the future I can compare the present rate of discharge with the past and see exactly how much my battery has deteriorated by. I'll take averages over long periods of time to account for, e.g. the fact that watching Netflix drains my battery faster than editing an essay. I also want a solution that uses negligible power in the background.
I've spent hours looking for an app that both calculates the rate of discharge and keeps all data, but I haven't found any. Eventually I decided that hopefully it isn't too difficult to write an AppleScript or something that simply logs the system clock and battery percentage in tandem every hour or so.
Thank you for your time!
Herman

What Barney said.
Here is the script to create a CSV text file with
Date
Time
Current Battery Percentage as an integer
#!/bin/bash
batterycsv="$HOME/battery.csv"
export GREP_OPTIONS="--color=never"
# if you want the percentage sign too, exclude the second egrep
battpct=$(pmset -g ps | egrep -o "(\d+)%" | egrep -o "\d+")
datetime=$(date "+%Y-%m-%d %H:%M")
printf "%s,%s,%s\n" $datetime $battpct >> $batterycsv
Output on a fully charged MacBook Air to battery.csv will be individual lines of the following format:
2014-08-09,19:49,100

Similar Messages

  • How can i delete the duplicate pictures and movie clips on my macbook pro

    how can i delete all the duplicate pictures and movie clips on my macbook pro. it is telling me i have no memory

    By 'no memory' may I assume you are out of space on your hard drive?
    Obviously you can delete them one by one, but this is tedious and will take a long time and you wish to do this quickly and efficiently.
    This is my suggestion and it may not be worth a lot:
    If all of your duplicates have a unique characteristic common to them that the originals do not, this MIGHT work.  For example if you make a duplicate of an image, it will have the same title as the original, but will insert the word 'copy' in its' title.  (It should do some thing similar with movie clips).
    Go to Spotlight in System Preferences.  Click on Privacy (near the top of the pane) and then the + sign (near the lower left hand corner).  This will result in a drop down menu.  Select all the places you do not want Spotlight to search.  You should leave only Music and Movies unless you have pictures/movie clips in other places.
    Enter into spotlight the unique characteristic (ie; copy) and it should (I hope) list all your duplicates.  Perform a Select All, and put them in Trash.
    Otherwise do them one by one or write an Apple Script Program.
    If my convoluted idea does not work, perhaps you will be lucky and a more savvy person with a real solution will come forth!
    Caio.

  • I am missing the battery percentage and accessibility in my usage section

    I am missing the battery percentage and accessibility in my usage section.  I have the current update...anyone know?

    Not available to the iPhone 3G.

  • How do i uninstall CS2  -  the old version doesn't open on my macbook pro i am reinstalling an updated version

    how do i uninstall CS2  -  the old version doesn't open on my macbook pro i am reinstalling an updated version

    You simply trash it.
    Mylenium

  • I have just upgraded to the new OS X V. 10.10.3 but cannot access my iCloud Drive documents using the resident Pages and Numbers software on my MacBook Pro. Help needed.

    I have just upgraded to the new OS X V. 10.10.3 but cannot access my iCloud Drive documents using the resident Pages and Numbers software on my MacBook Pro. Help is needed to access those documents using the resident software on my MacBook Pro rather than the Beta software on iCloud.com.

    I have iCloud Drive set on the Finder sidebar and use that to open the Numbers Spreadsheet on iCloud.
    OSX 10.10.3
    Best.

  • How to get pics in the iphoto app for iphone back onto my macbook pro

    I need to know how to get my pics that are stored on iphone in the "iphoto app for iPhone" back onto my macbook pro's iphoto. macbook was recently wiped out (i didn't back up) during Genius Bar repair

    See this support article  http://support.apple.com/kb/HT4083
    The safest way would be to share all photos that are in iPhoto albums to the Camera Roll. When you connect the iPhone to your Mac and open iPhoto you can download the contents of the Camera Roll just like from any camera.

  • Why is the sound being played back on my retina macbook pro?

    I bought a 13inch retina macbook pro on friday last week. I use Skype daily and chat with friends but I am having an issue. Lets say I am on Skype and chatting with people and I listen to music or watch youtube video at the same time the call is going. The person on the other line of skype can hear what ever is going on clear as day. I ALWAYS use my apple earpods while on skype and listening to music. I had a 13inch 2010 macbook pro and it never did this while on skype and listening to something. I took it back to bestbuy where I bought it thinking it was just defect and they replaced it for me, but this computer is doing the same. Is there a defect or something? I want to know becuase this is exreamly annoying.

    He's talking about it happening when he's using headphones, that is not normal.
    In your system preferences, under sound, in the last tab, use the test microphone function to find out whether Mountain Lion itself is causing you to hear things back or if Skype is sending your audio playthrough to the person your in a video call with.

  • ¸How do you take out the battery percentage on the ipod touch

    how do you take out battery percentage on new ipod touch

    What do you mean by "take out battery percentage"  There is not way to get the % battery to show in the upper right.  You can purchase apps that show battery %.

  • I have a MacBook Pro and one day, my dock disappeared and so did the time, the battery percentage, and the spotlight!  The left side of my top bar is still there showing the Apple sign with the application that is open and other options. I need help!!

    Help pls!

    Reinstall OS X without erasing the drive
    Do the following:
    1. Repair the Hard Drive and Permissions
    Boot from your Snow Leopard Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior and/or Tech Tool Pro to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Reinstall Snow Leopard
    If the drive is OK then quit DU and return to the installer.  Proceed with reinstalling OS X.  Note that the Snow Leopard installer will not erase your drive or disturb your files.  After installing a fresh copy of OS X the installer will move your Home folder, third-party applications, support items, and network preferences into the newly installed system.
    Download and install the Combo Updater for the version you prefer from support.apple.com/downloads/.

  • What is the battery expectancy for late 2009 13-inch macbook pro

    I have a 13-inch, Mid 2009 Macbook pro and it seems that the battery has been draining quite fast.  It was ast 85% charge about 30 minutes ago and now it's down to 24%.  Is this typical for "normal wear" usage? or could this be a battery issue?

    Yes and No. It all depends on many factors.
    Age of battery, yours is 3+ (going on 4) years old.
    Use of battery, how many cycles does it have.
    Usage habbits, whether you are in the habbit of draining the battery down to the point the system almost shuts off or does shut off, neither is good for the battery. Leaving it connected to the AC all the time. There is a system included to drain the battery and recharge it. But it doesn't do it enough or starts the recharge at to high a percentage creating a long term Short Cycle condition.
    All batteries only last so long. 3+ years isn't bad and yours still works although it does lose it charge more rapidly, which is to be expected with age and use.
    Even if you never really used it and it sat on a shelf eventually that battery would be no good. Li-ion batteries have a shelf life. Used or not used it will eventually fail to work.

  • How can I make the text crisper and less blurry on my MacBook Pro?

    I just purchased my first MacBook Pro, and I absolutely love it, save for one potential deal breaker: The text displays blurry. Instead of stark, black on white text, there is a slight halo of grey (or whatever color the font is in) around every character. It makes the text look nice, but much harder to read. The characters are deliberately out of focus. Apparently this is normal, according to this article: http://seattletimes.nwsource.com/html/businesstechnology/2015823073_ptmrsh06.htm l
    Is there a way to fix (or work around) this? As a writer, I cannot type for eight hours a day on a computer that "softens" the text. I have tried adjusting my screen resolution (it's at the highest possible) and turning off "font-smoothing" (it's off). Nothing works. I called Apple support and they couldn't help me either. I can't believe there's not an easy fix for this.

    Humor me.
    Let's revisit the things you did, because they -should- have fixed the problems.
    !) to set screen resolution, you MUST use:
    System Preferences > Displays ...
    Use of the MenuBar item simply shows the last three chosen, not all available.
    And what is the screen resolution you are using now? 13" 15" or 17" display? Do you have the default glossy screen or the enhanced matte display?
    2) font smoothing.
    System Preferences > Appearance.
    I see no OFF. I see a checkbox to default to LCD smoothing, and I see   "turn off font smoothing for characters smaller than nn point", where nn is 4 to 12.
    How do you have these set?

  • How can I see what the volume of my hdd is on my macbook pro

    i need to see how full  the hdd is.  How can I pull up a visual on the file volume on my macbook pro?

    Select it in the Finder and choose Get Info from the File menu.
    (86668)

  • How do I transfer Notes from my iPhone4s and iPad to my new MacBook Pro?

    How do I transfer Notes from my iPhone4s and iPad to my new 13" MacBook Pro with retina display?

    Finally figured it out...
    1) Open mail/compose notes on your macbook...
    2) copy and paste every note from Outlook to a new note in Mail.
    3) Open iTunes. In Info/Advanced tick Notes. This will replace / copy all Notes from Mail to your iPhone...
    4) Voila! Notes are on iPhone...
    I must say in spite of all the fabulous advantages of a Macbook and an iPhone, syncing really does suck...
    Transferring data from another smartphone to a Mac or an iPhone is tough...
    Features like "one way / two way" sync for Phone / computer or allowing us to select which whose, phone or computer, will be considered more important so that you can choose whose data will overwrite the other, are not there in iTunes... This is something which really needs to be there...
    Anyways... problem solved for now...
    ciao...
    Jesal

  • HT1751 I cannot seem to get through this process.  I believe I have copied the library from my old to the external drive, and then to my newer MacBook Pro; but the result is the same number of songs that were originally transferred via the transfer proces

    I've tried for a few days to figure out why I cannot be sure that my iTunes back-up to an external drive has "worked" or not.  I finally decided to try to transfer the content from the external drive to my newer MacBook Pro.  I already knew that the number of songs on the newer laptop were fewer than what are on my older one.  (I basically only use my older MacBook Pro now for iTunes.)  But today, still had not luck.  There is still a difference of over 100 songs appearing on the iTunes of the newer laptop than are on the older one. 
    I'm pretty sure that I just don't undertand the Apple article very well:  "ITunes: back up your iTunes library by copying to an external hard drive."
    This would not be so frustrating for me did I not have over 3000 songs, imported from CDs that I myself own, in my old laptop.  The thought of redoing this import is, well, tiring to say the least. 

    Go through the below forum with similar issue and follow the process mentioned by "Macjack" in the beginning.
    https://discussions.apple.com/thread/4499820

  • HT4528 My iPhone and iPad will receive .msn e-mails, but I cannot respond to them, getting a message that says "User name or password incorrrect" when the same username and password works on mt MacBook Pro.  What gives?!

    My iPhone (and iPad) will receive .msn e-mails but will not allow me to respond or forward, giving an error message that says the username or password are incorrect for the SMTP, but the same configuration allows me to receive AND send from my MacBook - what can I do to correct this?

    Alright, I'll take a mea culpa on this.  I just recalled the one thing I didn't try which was establishing an application-specific password for the phone:
    http://www.google.com/support/accounts/bin/static.py?page=guide.cs&guide=1056283 &topic=1056286
    This seems to have worked.  Yay!

Maybe you are looking for

  • In UPGRADE from 4.7c to ecc6.0 ME21N  Transaction PO doesn't print

    Hello Guru's, Will anyone give answer while upgrading(4.7C to ECC 6.0) in ME21N transction PO doesn't printing.  will you provide which OSS will support to rectify the problem. Full points for the answer. Regards, PV

  • Media Encoder CS5 crashing on quit

    I'm testing deploying CS5 with filewave.  Thus far it seems to be working well except for every time I open up Media Encoder CS5 and then quit it, upon quitting, it crashes stating, "Adobe Media Encoder CS5 quit unexpectedly". Any ideas how I can res

  • Office Web - wrong URL

    Hello everyone, I getting some error messages from my Office Web App server showing that is being accessed trough the wrong URL. I setup the server to be accessed trough HTTPS for internal and external trough the same public domain. However there is

  • HT201210 Stuck in Activation Limbo, How do I get out of it?

    I have an iPhone 4s. I've had iOS7 ever since the beta came out. I received it with my iOS Developer Certificate. Last night my phone just went into the Activation Mode, like when you turn your iPhone on for the first time. It is stuck in Activation

  • Routine help - urgent

    Hi guys, Need help for routine code, i have rquirement currency translation based on currency type  In the cube we having the Amount Key Figure in USD. i want to convert these values based on currency type or company code . ..GBP,JPY,INR,KRW..etc. ca