I found this: 
http://www.nextofwindows.com/find-out-how-healthy-your-battery-is-on-your-windows-7-laptop/

Bob S


On Feb 20, 2015, at 23:59 , Richard Gaskin 
<ambassa...@fourthworld.com<mailto:ambassa...@fourthworld.com>> wrote:

Peter M. Brigham wrote:

Just out of curiosity, how *would* you do this via shell call or
the equivalent on a Windows laptop?

Good question.

Thanks to the beautiful simplicity of the Linux /proc directory I was able to 
find:

 cat /proc/acpi/battery/BAT1/state

The "charging state" field there will contain "charging" or "discharging".

Now if we can turn up a Win command line solution I'll write a handler for this 
that'll make it convenient to get this info on all three platforms.

Martin, thanks for handling the Mac side - nice work.


On Feb 20, 2015, at 11:19 AM, Martin Koob wrote:

Hi Richard

I noticed in your bug report was for Mac so till that enhancement gets
implemented you could use this.

function powerStatus
 put shell ("pmset -g batt") into tPowerStatus
 put matchtext(tPowerStatus, "'([^']*)",tPowerSource) into tSuccess
 return tPowerSource
end powerStatus



--
Richard Gaskin
Fourth World Systems
Software Design and Development for Desktop, Mobile, and Web
____________________________________________________________
ambassa...@fourthworld.com<mailto:ambassa...@fourthworld.com>        
http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com<mailto:use-livecode@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to