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.