[jawsscripts] Re: scripting noobie (again)

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 4 Jul 2010 14:07:01 -0400

Perhaps you need to get over the hurdle of thinking in terms that JAWS 
Scripts do. JAWS Scripts is procedural, event driven code.  It is not object 
oriented like Python.  All of the functions are started by window events or 
other scripts / functions.Windows events would be things like 
WindowCreatedEvent or NewTextEvent.  Scripts differ from functions in that 
they can not have any parameters and they have a key attached.  In Linux, 
this would be called a key binding.  When that key or key combination is 
pressed, the script code will be called.  Therefore, to provide a custom 
message for Control + S, you would write a script by using the "New Script" 
item from the menus.  In the New Script dialog, fill out the Name, Synopsis, 
Description, and the Attached key.  In the Attached Key field, just press 
the  Control + S combination then Tab to the Ok button and press Enter to 
activate.

It will insert the structure of the script and place the cursor in the 
middle of the script.  Then add your code as in the example below.

Script MySave ()
SayMessage (OT_MESSAGE, "Save document", Save")
TypeCurrentScriptKey ()
EndScript

Don Marang

--------------------------------------------------
From: "Alex Hall" <mehgcap@xxxxxxxxx>
Sent: Sunday, July 04, 2010 1:15 PM
To: <jawsscripts@xxxxxxxxxxxxx>
Subject: [jawsscripts] scripting noobie (again)

> Hello all,
> I was on here several months ago, trying to figure out how to write a
> basic script for jaws that would speak a hard-coded message when a key
> was pressed instead of speaking the keystroke itself. I am again
> trying to solve this problem, but I cannot locate any responses I
> received last time around. I am a long-time jaws user, and am
> comfortable in Python and Java, but the Jaws scripting language seems
> somewhat clunky and not as smooth or straightforward, though that is
> from an self-proclaimed scripting newb.
> Is there a simple way of doing this? That is, catch a keystroke, and
> speak a message in place of speaking the keys pressed. I apologize
> that I am asking again, but I now have more time than I had before. I
> wish I could locate the emails I had from my last try, but I am not
> sure where they would be.
> I have read through the scripts to Jamal Mazrui's Edsharp program, but
> I could not find where he set things up to speak custom messages. For
> example, in that program with the scripts installed, jaws will say
> "save" when control-s is pressed, and not "control s" at all.
>
> -- 
> Have a great day,
> Alex (msg sent from GMail website)
> mehgcap@xxxxxxxxx; http://www.facebook.com/mehgcap
> __________�
>
> 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

Other related posts: