[jawsscripts] Re: to make laptop battery say
- From: Doug Lee <doug.lee@xxxxxxxxxxxxxxxx>
- To: jawsscripts@xxxxxxxxxxxxx
- Date: Fri, 23 May 2008 19:14:55 -0400
Ah, nope, the problem isn't missing brackets. Some lines wrapped when
I pasted that script, and I didn't notice. Here's the same script
without wrapped lines, at least I'm not letting them wrap at this
end...
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
On Sat, May 24, 2008 at 08:55:52AM +1000, Scott Erichsen wrote:
Doug,
The code you sent doesn't compile and I cant figure out why.
I think there's some brackets missing.
Scott
-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Doug Lee
Sent: Friday, 23 May 2008 7:46 PM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: to make laptop battery say
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
On Fri, May 23, 2008 at 12:18:35PM +0300, Can K?rca wrote:
hi friends,
I'm using jaws 9.0 and turkish version windows.
the jaws that I'm using doesn't say the battery state.
when i try to make it say, jaws says; "battery status not found"
what shall i do?
i would be glad if you could help me.
Can K?rca
__________?
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
--
Doug Lee, Senior Accessibility Programmer
SSB BART Group
mailto:doug.lee@xxxxxxxxxxxxxxxx http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
__________?
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
--
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
- Follow-Ups:
- [jawsscripts] Re: to make laptop battery say
- From: Scott Erichsen
- References:
- [jawsscripts] to make laptop battery say
- From: Can Kırca
- [jawsscripts] Re: to make laptop battery say
- From: Doug Lee
- [jawsscripts] Re: to make laptop battery say
- From: Scott Erichsen
Other related posts:
- » [jawsscripts] to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- » [jawsscripts] Re: to make laptop battery say
- [jawsscripts] Re: to make laptop battery say
- From: Scott Erichsen
- [jawsscripts] to make laptop battery say
- From: Can Kırca
- [jawsscripts] Re: to make laptop battery say
- From: Doug Lee
- [jawsscripts] Re: to make laptop battery say
- From: Scott Erichsen