Sunday, July 20, 2008

Automating day to day work using jaws scripts

Automating day to day work using jaws scripts
Recently, I was little bit out of jaws scripting business, as there were some other task which were on higher priority. Any which ways those task got over

and again I am thinking about jaws scripting, making my exodus and other nonaccessible applications usage more smooth.
But in last few months while I was working, I found some task which were performed repeatedly like getting files from the repository and committing files to

repository. I thought of writing some sort of script to do this. I could have done this using any scripting language, but then i have to go to command prompt

and execute those scripts. Well suddenly a thought came to my mind that hey, I can also do this using jaws script engine. That's it, I simulated my actions

on those files and wrote them in jaws script to do it for me every time.
This script was actually activating the "APPLICATION" (context menu) key, looping through the options available in the menu, if found the desired option then

activating that menu by sending the "ENTER" key.

Here is the code that I wrote:
Script SVNUpdate ()
var
int IsMenuSVNUpdate,
string CurrentMenu,
int loopSafety

TypeKey ("F5")
SaveCursor ()
TypeKey ("SHIFT+F10")
RouteJAWSToPc ()
While (!IsMenuSVNUpdate && loopSafety<20)
Let CurrentMenu=GetLine ()
If (CurrentMenu=="SVN Update") then
RouteJAWSToPc ()
let IsMenuSVNUpdate=1
Let loopSafety=20
LeftMouseButton ()
Else
NextLine ()
EndIf
let loopSafety=loopSafety+1
EndWhile
TypeKey ("ALT")
RestoreCursor ()
EndScript

Script SVNCommit ()
var
int IsMenuSVNUpdate,
string CurrentMenu,
int loopSafety

TypeKey ("F5")
SaveCursor ()
TypeKey ("SHIFT+F10")
RouteJAWSToPc ()
While (!IsMenuSVNUpdate && loopSafety<20)
Let CurrentMenu=GetLine ()
If (CurrentMenu=="SVN Commit...") then
RouteJAWSToPc ()
let IsMenuSVNUpdate=1
Let loopSafety=20
LeftMouseButton ()
Else
NextLine ()
EndIf
let loopSafety=loopSafety+1
EndWhile
TypeKey ("ALT")
RestoreCursor ()
EndScript


Yes script is very simple and is not refactored properly, but what I want to convey through this post is jaws scripting can also make life easier for tasks

that have to be performed repeatedly.

"Make nonaccessible application more accessible and accessible applications more usable"

Tuesday, March 11, 2008

Using comm components in jaws scripts

Hi friends, have u ever faced a situation that you can write code in some other language, but that is not possible using jaws scripts? We can actually solve problem but we can not always solve that problem using jaws script.

Here is the solution for that. If you know any language that supports comm compatebility then you can actually write some functions in that language and compile your code and also make it a comm dll, now you can register your comm component in windows using regsvr32 and start using functions written in that component. You can create objects of your comm component by using CreateObject function of jaws script engine and pass required parameters to them. Comm can give your scripts a great power which in some cases is not possible in jaws scripting.

Thursday, November 29, 2007

Events in JAWS Scripts

Since I started writing jaws scripts for Exodus application which is an instant messenger built on jabber platform, I was wondering how jaws announces certain text in other application like some text is spoken by jaws at startup.

I started writing scripts that were executed on certain keystrokes. Then I found there were many events that we can subscribe in our scripts. I opened the default.jss file which is the default script, I found many events and their parameters information, most of the events are self-explanatory.

Just copy any of the event's first line that looks something like: "Void Function EventName" followed by the parameters in the round brackets. Try writing some debug code that will use any of the parameters, you will quickly come to know what each parameter is about. I am sure your scripts will become more efficient than writing scripts which moves the active cursors and reaches certain areas of the screen and then telling jaws to read lines, words or characters.

Monday, November 19, 2007

Introduction

Hi friends,
Let me introduce myself. I am Gopal Rohra, I am working as a software engineer in a reputed firm in Mumbai India. I am visually impaired (partially). I will be writing on jaws scripting, creating scripts using advance techniques.