[jawsscripts] Re: Running a script based upon a string

  • From: "Brian Hartgen" <jaws@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 31 Jan 2012 11:24:52 -0000

Doug, if you lived nearer to me I would buy you a drink this evening! That 
is exactly what I wanted and it works beautifully!

Thank you!

Brian

----- Original Message ----- 
From: "Doug Lee" <doug.lee@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Tuesday, January 31, 2012 11:13 AM
Subject: [jawsscripts] Re: Running a script based upon a string


var string temp
; Run the sayLine function.
let temp = "sayLine"
formatStringWithEmbeddedFunctions("<" +temp +">")
; Run the sayLine script.
let temp = "$sayLine"
formatStringWithEmbeddedFunctions("<" +temp +">")
; Run something with arguments.
let temp = "sayString(\"Hi there!\")"
formatStringWithEmbeddedFunctions("<" +temp +">")
; Get a function's return value too.
let temp = "sysGetDate()"
var string result
let result = formatStringWithEmbeddedFunctions("<" +temp +">")
sayString("The current date is " +result)

You can run almost anything like that.  There are a few limitations on
temp though: No variable references, no nested function calls, and
embedding quotes in an argument is difficult if not impossible. As far
as return values go, everything comes back as a string. You can't get
an object pointer back, but you can get window handles, integers, etc.
and convert them back from string to native type.

The formatStringWithEmbeddedFunctions function is pretty much what
made BX possible back in 2003.

On Tue, Jan 31, 2012 at 08:44:08AM -0000, Brian Hartgen wrote:
Hi everyone!
I am creating some scripts to help out a jaws user. It's quite an 
interactive project which is almost complete but I have a question if anyone 
can please help.

I have the name of a jaws script contained within a text string, called 
temp. What I want to do is run a jaws script based upon the text stored 
within the string. So, if jaws is aware of the fact that the string temp 
contains the words SayLine, I want it to run the script for SayLine, reading 
the current line. Is it possible please to do this?

Thanks.

Brian Hartgen
__________???

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

-- 
Doug Lee, Senior Accessibility Programmer
SSB BART Group - Accessibility-on-Demand
mailto:doug.lee@xxxxxxxxxxxxxxxx  http://www.ssbbartgroup.com
"While they were saying among themselves it cannot be done,
it was done." --Helen Keller
__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts

__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: