[jawsscripts] Re: Maximize Window Scripting Problem

  • From: Daniel Dalton <daniel.dalton47@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Fri, 12 Oct 2007 17:48:00 +1000

On 12/10/2007 5:14 PM, Matthew2007 wrote:
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

Text strings should always be placed between quotes.
So some examples include:
let x ="hello"
X must be a variable of type string.
I guess you can do the same with constants but I am not to good with jaws scripting. But remember a constant stays the same value In other words you can only give it a value once when you define it. But this isn't related to your question really.

saystring(hello) it will voice the string assigned to the variable hello.
Obviously you will get compile errors if hello is not of type string.
And if it doesn't exist it won't compile either.

Anyway you were missing a quote.
Here is a corrected line:
SayFormattedMessage (OT_MESSAGE, "Window Maximized", "Maximized")

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.

Did you expect to hear the message when you commented it out? You correctly worked out that was the problem but commenting something out might make it work but you won't have that code that is commented out executed. Did you know that anything to the right of a ; is ignored by the compiler? So a comment? (Different in other languages like c)

Are you copying and pasting from the manual? Because I don't think the manual would miss out a quote.


--
Daniel Dalton

http://members.iinet.net.au/~ddalton/
daniel.dalton47@xxxxxxxxx
__________ 
View the list's information and change your settings at http://www.freelists.org/list/jawsscripts

Other related posts: