Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do shell script "pmset -g batt | grep InternalBattery | column -t"
- set x to the result
- set percentage to word 6 of x
- set state to word 7 of x
- set t1 to word 8 of x
- set t2 to word 9 of x
- set remaining to the word 10 of x
- if remaining contains "remaining" then
- if state is "discharging" then
- return percentage & "%"
- else if state is "charging" then
- return percentage & "% | " & "charging"
- else
- return percentage & "% | charged"
- end if
- else
- return percentage & "% | " & "calculating"
- end if
Add Comment
Please, Sign In to add comment