[jawsscripts] Re: to make laptop battery say

  • From: "Paul Magill" <magills@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 24 May 2008 17:52:53 +1000

Hi Scott,

Sounds like the .jss file in which you have the script, may not have a
   include "HJConst.jsh"
line at the top???

without including that file, the OT_User_Requested_Information  constant 
will not be recognised by the compiler.

Regards,
Paul from Aust

----- Original Message ----- 
From: "Scott Erichsen" <pianoman@xxxxxxxxxxxxxxxxx>


Doug,

Thanks for this, but it still won't compile. I have put a blank line before
and after the lines that are refusing to compile.

I didn't think OT_USER_REQUESTED_INFORMATION was a variable


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

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

Other related posts: