John G,Great job hunting down this solution! Got another little quirk I'm hoping you might investigate.
One of the lessons to be learned from this task was to write this script so that jaws will audibly verbalize to the user that in fact the window is already maximized if I try to maximize it and its already maximized. This single message doesn't seem to be manifesting itself, and I'm given an error message in this script stating: "compile error, incorrect parameter format. The statement with the error is as follows: SayFormattedMessage (OT_MESSAGE, "Window Maximized", Maximized"). If I place a semicolon at the beginning of this SayFormattedMessage statement, my entire script will compile just fine, but I won't hear the "maximized" message. Again, if I use a semicolon to block this statement the script works as I can hit my maximize hotkey and any page within IE will maximize as if I hit alt plus space then letter x. The problem of course is that I should be hearing the SayFormattedMessage statement audibly verbalizing the fact that my window is already maximized. I will paste below the code the scripting manual states should work but actually doesn't. Maybe you can give it a try and see if it will somehow work for you. Don't forget to include the TypeKey (cKSSpace) solution you gave me.
From the manual:"Your script should begin by checking the application window for the restore symbol. The presence of the restore symbol can be used to determine if the window should be maximized. You can use the invisible cursor to move to the top of the window and then subsequently to the restore or maximize symbol. If your script finds the restore symbol, then speak a message advising the user the window is already maximized and exit the script without any further processing."
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 cursorRouteInvisibleToPC (); 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 symbolSayFormattedMessage (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 Thanks, Matthew---- Original Message ----- From: "John Greer" <jpgreer17@xxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx> Sent: Thursday, October 11, 2007 10:39 PM Subject: [jawsscripts] Re: Maximize Window Scripting Problem
OK yeah it is an outdated script problem. For jaws 8 the command will be: TypeKey (cksSpace)----- Original Message ----- From: "Matthew2007" <matthew2007@xxxxxxxxxxx>To: <jawsscripts@xxxxxxxxxxxxx> Sent: Thursday, October 11, 2007 11:44 PM Subject: [jawsscripts] Maximize Window Scripting ProblemHi 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 cursorRouteInvisibleToPC (); 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 windowJAWSPageUp () JAWSEnd () PriorWord () If GetWord () == "Restore Symbol" Then; check for the restore symbolSayFormattedMessage (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 EndScriptTip: 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__________ View the list's information and change your settings at http://www.freelists.org/list/jawsscripts__________ NOD32 2587 (20071011) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com
__________View the list's information and change your settings at http://www.freelists.org/list/jawsscripts