[jawsscripts] Re: Battery status script

  • From: "Travis Roth" <travis@xxxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 18 Sep 2008 08:45:11 -0500

Shift+JAWSKey+b is JAWS' default battery level script. It doesn't always
work but if it works for you, you're in business.

In addition, Doug Lee posted an enhanced battery level script to this list
back in May.
Here is his message:
----
I have run with the following script in my custom default.jss for quite a
while now.  It lets a single SayBatteryLevel (Shift+JAWSKey+B) command run
the original JAWS code but runs custom code if you type the command twice
quickly.  I wrote this a while back for myself because sometimes JAWS is
unable to find the battery information on my laptop.  It will attempt to say
three things, in this order:
Percentage of battery power remaining even if running on AC, then current
power source (AC Power or batteries), then time remaining ("unknown" when on
AC power generally).

script sayBatteryLevel()
var
        handle hwnd
if !isSameScript() then
        performScript sayBatteryLevel()
        return
endIf
let hwnd = findTopLevelWindow("SystemTray_Main", "") if hwnd then
        let hwnd = getLastWindow(getFirstChild(hwnd))  ; Dialog containing
details
        let hwnd = getFirstChild(hwnd)
        while hwnd && !stringContains(getWindowName(hwnd), "%")
                let hwnd = getNextWindow(hwnd)
        endWhile
        if stringContains(getWindowName(hwnd), "%") then
                ; Say total remaining battery power percentage, even if on
AC power.
                sayMessage(OT_User_Requested_Information,
getWindowName(hwnd))
                ; Then say "AC Power" or "Batteries" to indicate which is in
effect.
                sayMessage(OT_User_Requested_Information,
getWindowName(getNextWindow(hwnd)))
        endIf
        let hwnd = getLastWindow(hwnd)  ; Time remaining
        sayMessage(OT_User_Requested_Information, getWindowName(hwnd))
        return
endIf
performScript sayBatteryLevel()
endScript

----

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of don mauck
Sent: Thursday, September 18, 2008 8:31 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Battery status script

Hello, 
I seem to remember someone posting a battery status script on this list at
one time, am I correct?  Or, does Jaws provide a key to do this and I just
can't find it?  Thanks. 
 
Regards,
 Don
 
Oracle <http://www.oracle.com/> 
Don Mauck | Accessibility Evangelist 
Oracle Corporate Architecture Group
7700 Technology Way
Denver CO 80237
Phone (303) 334-4184
Email don.mauck@xxxxxxxxxx 
 

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts


__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: