[jawsscripts] Maximize Window Scripting Problem

  • From: "Matthew2007" <matthew2007@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Thu, 11 Oct 2007 21:44:55 -0700

Hi all,

I was running through Chap 10 Exercise #2 of the scripting manual and came across a problem I couldn't figure out. I have included the entire script I was working on below. I followed all instructions, but when I tried to compile I was given a message telling me: "unknown variable cKS26." the following is the info I was asked to enter into my script:

TypeKey (cks26 )
; type the space bar to activate the Application Control menu
; You can find the keystroke constant, cKS26 in the common.jsm JAWS Script Message file (jsm).

What in the heck am I to do with "cks26)?" I haven't a clue what this is and I've looked through the common.jsm file to no avail. Where can I read up on this? (completely confused and dropping fat forehead in hand)

Here is the complete documentation of the script:
Note: I will put *** where I'm stuck.

list of 6 items
. Script Name: MaximizeWindow
. Can be Attached to Key: Checked
. Synopsis: Maximizes the active application window.
. Description: Uses keystrokes to maximize the active application window
. Category: Keyboard
. Assign to: CTRL+M
list end

MaximizeWindow Script:

Script MaximizeWindow ()

Var

string sKeystroke

let sKeystroke = "X"

SaveCursor (); save the active cursor

; before we activate the menu then maximize the window, we must be sure it is not already maximized.

InvisibleCursor ()

SaveCursor (); save the invisible cursor

RouteInvisibleToPC (); move the invisible cursor to the location of the PC cursor

; The following three statements move to the restore or maximize symbol in the upper right corner of the application window

JAWSPageUp ()

JAWSEnd ()

PriorWord ()

If GetWord () == "Restore Symbol" Then; check for the restore symbol

SayFormattedMessage (OT_MESSAGE, "The window is already maximized", "Window is maximized")

Return; exit the script as the window is already maximized

EndIf

SpeechOff (); turn off speech

ActivateMenuBar (); activate the menu

Delay (3); give the menu time to open

If MenusActive () Then; make sure the menu bar is active or open

***TypeKey (cks26 ); type the space bar to activate the Application Control menu

; You can find the keystroke constant, cKS26 in the common.jsm JAWS Script Message file (jsm).

; This file is already included in the default script file, Default.jss.

Delay (2); allow for the system to catch up

TypeKey (sKeystroke)

SpeechOn ()

SayFormattedMessage (OT_MESSAGE, "Window Maximized", Maximized")

Else

SpeechOn ()

SayFormattedMessage (OT_ERROR, "Menu could not be activated")

EndIf

EndScript

Tip: Like the messages in the previous exercise, you can add the messages in this exercise to the same message file. See 8.0 Creating and Speaking Messages for more information on the creation of individual messages within a message file.

Thanks

Matthew


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

Other related posts: