Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi,

That *is* in AppleScript - although it's using "do shell script" to execute some shell commands. If you're after method of doing it entirely in AppleScript then I don't think there is one (as far as I know).

You just basically need to do:

Code:
set theReturnedText to do shell script "pmset -g batt"

...then chop the bit you need out of theReturnedText as required.

I guess you'd want to run it in some kind of loop, or in an on idle handler, depending on your needs.

An even smarter way would be to initiate the check with launchd.

Good luck!
 

Senor Cuete

macrumors 6502
Nov 9, 2011
421
30
Looking at this further, it looks like this is available in the iOS 3.0+ SDK, so not available for OS X.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.