[jawsscripts] Need help. script not working

  • From: Lennie Rinaldi <merlin739@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Mon, 21 Apr 2008 13:47:06 -0400

Hi Listers,

I have a script that I want to use to cut down the number of keystrokes to get to a particular button.

The application is a CD catalogue program and when I manually add a new CD, I need to go to the "Link album to disc" button to calculate the total time of the CD.

My script is not working. I open up a detail window to move to varrious information pertaining to the CD, such as the album title, genre, total time etc., but when I use a shortcut key to move to the button, I always get the message that the "Link the album to disc" cannot be found.

My script is below. Thanks for any help or suggestions.

Lennie

The script starts here:

Script GoToLinkAlbum ()

Var

handle hGrip,

string sAlbum,

string sLink,

int iCount

let sAlbum = "Album"

let sLink = "Link album to disc"

let iCount = 0

TypeKey (cKSDetail)
; open the album detail window

SaveCursor ()

RouteJAWSToPc ()

;SayWord ()

If GetWord () != sAlbum then

SayMessage (OT_ERROR, "You must be in an album to perform this function. Request cancelled")

JAWSCursor ()

JAWSPageUp ()

JAWSEnd ()

LeftMouseButton ()

RestoreCursor ()

        Return

EndIf

RestoreCursor ()

TabKey ()

; This tab moves to the list of various controls pertaining to the album

let hGrip = GetCurrentWindow ()

let iCount = 1

while iCount < 19
; Look for Control ID 96 which is the 18th item pertaining to the album

GetControlID (hGrip)

If (GetControlID(hGrip) != 96) then

let iCount = iCount + 1

TabKey ()
; move to the next item

let hGrip = GetCurrentWindow ()

else

let iCount = 20
; We found it

EndIf

EndWhile

If (iCount == 20) then
ShiftTabKey ()
;move to "Link album to disc"

        SayWord ()

Else

        SayMessage  (OT_ERROR, "The link album to disc cannot be found")

SaveCursor ()

RouteJAWSToPc ()

JAWSCursor ()

JAWSPageUp ()

JAWSEnd ()

LeftMouseButton ()
; close the detail window

RestoreCursor ()

EndIf

EndScript

Other related posts: