Battery testing, volume booster

Richard Miller wow at together.net
Tue Dec 7 19:00:33 EST 2004


Thanks, Sarah. That seems to work fine. Much appreciated.

Still looking for ideas on the volume boost from anyone else.

Richard


On Dec 7, 2004, at 5:51 PM, Sarah Reichelt wrote:

> Hi Richard,
>
>> Looking for ideas on how to accomplish two functions from within Rev:
>>
>> 1. Read the status of the internal battery (i.e. % charged);
>>
> I can't help with the volume boost, but here is the script I use for 
> reading the battery charge in an iBook. It requires the shell command 
> "battery" which you can download from 
> <http://www.mitt-eget.com/software/macosx/>. I couldn't get that link 
> to work this morning, so if you want the shell command, let me know 
> off-list and I can email you a copy.
> I put it into the "/usr/bin/" folder but you can put it anywhere you 
> like if you send the full path to the shell function. It can give you 
> a whole heap of info - run it in Terminal and check the help, but the 
> function below just returns the percent charge or "n/a" if there is no 
> battery.
>
>
> -- check battery level using OS X shell command
> -- battery script needs to be in /usr/bin/
> --
> -- returns percent charge or "n/a"
> --
> function batteryLevel
>   if isOSX() then
>     put shell("battery csv") into tBatt
>     put last item of line 1 of tBatt into tPercent
>     put item 4 of tBatt into tFlags
>     if char 6 of tFlags = 0 then
>       -- no battery connected
>       put "n/a" into tPercent
>     end if
>   else
>     -- OS 9 can't use shell commands
>     put "n/a" into tPercent
>   end if
>   return tPercent
> end batteryLevel
>
> Cheers,
> Sarah
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list