Posted on 03-10-2010 08:15 AM
Man, do I love the new extension attributes. Here's a script I whipped up today to get the Full Charge Capacity from a battery and put it in using an Extension Attribute.
I keep track of the Full Charge Capacity, as it's something Apple wants to know when I call in a battery that has died.
#!/bin/sh
echo "<result>$(system_profiler SPPowerDataType | grep "Full charge" | awk '{ print $5 }')</result>"
It's a pretty easy script, but I figured I'd throw it out here on the list so that anyone that wanted to use it wouldn't have to reinvent the wheel.
I'd be interested in knowing what other Extension Attributes people are using that they find helpful as we go along.
Thanks,
Robert
Posted on 11-05-2015 04:25 PM
Thanks for this!
Posted on 11-06-2015 01:47 PM
Very cool. On 10.10.5, I had to change the grep syntax to "Full Charge" - notice the capital C.
#!/bin/sh
echo "<result>$(system_profiler SPPowerDataType | grep "Full Charge" | awk '{ print $5 }')</result>"