I am totally new to scripting, and I would like to create a script that results in “AC Power” or “x%”(x=remaining percent battery charge).
The info that I want is in the “pmset -g ps” terminal command and the I am sure one of the scripts from http://www.macscripter.net/viewtopic.php?id=24813 contains most if not all of what I need to do this, but since I am so new I am not sure how to go about putting the script together. I know it requires some “if/then” type of statement, but I don’t know how to do that yet. I am up to getting the computer to beep (sometimes on purpose even!).
BTW, the idea behind this is so I can display the results with geektool on my desktop.
I would appreciate whatever help you can give me, and also if it is not too much trouble, maybe some explanation of how it works, so I can learn from this.
Thanks!
(I posted in the thread I linked but then realized people will probably not be interested due to the age)