[jawsscripts] Re: chopping up block of text on Tab delimiters or via color? String monipulation,

  • From: "Paul Magill" <magills@xxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 23 Mar 2009 22:25:07 +1100

Hi Geoff,

The below is pretty rough as I had little time, but it does the job using 
Jaws 8.

Script TestOnF8 ()

var

string StringVar, ; the list of keys & their uses obtained from the screen

string AnnounceString,

string VirtualShowString



;let StringVar = the function you are going to use to collect the whole list 
of keys

; the below LET line, is a dummy up to simulate a guess at what the above 
LET line may obtain

; the \9 is for Jaws, the tab character. The \9 *MUST* always appear in a 
quoted ("") string.

; the text you pick up with the above LET line, will already contain tabs, 
so no adjustment is required

LET StringVar = "function description1 = F1\9function description2 = 
F2\9function description3 = F3"

; this will read ok if the tab character immediately follows a text item 
without any intervening spaces, as in the sample above

; note that the tab is replaced by a period & 2 spaces as in normal 
sentences

let AnnounceString = StringReplaceSubstrings (StringVar, "\9", ". ")

; here, the tabs are replaced by the line feed character, \N, in Jaws.

let VirtualShowString = StringReplaceSubstrings (StringVar, "\9", "\N")

if IsSameScript () then

; replace the below line with your way of displaying the user buffer

SayMessage (OT_User_Buffer, VirtualShowString)

ELSE ; hit once

; replace the below line with your way of saying a string

SayString (AnnounceString)

EndIf ; key hit once or more

EndScript


----- Original Message ----- 
From: "Geoff personal" <gch@xxxxxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Monday, March 23, 2009 12:19 PM
Subject: [jawsscripts] chopping up block of text on Tab delimiters or via 
color? String monipulation,


aha Mighty Scripters.

I wonder if someone might be able to assist me with some fancy string
monipulation knowledge?
I have a problem in a terminal emulation environment application I am
scripting, whereby there's this whole 3 line block of helper text for the
user , denoting the role of the function keys on any given screen.
However of course, they don't have nice periods after each one, nor even
commas, so speaking a GetTextInRect on the block of course just spiews them
all out in one unpleasantly incomprehensible continuous stream of text.
However of course on each screen, the length of each function key
prompt/string of text which needs pauses inserted between them, and which I
wish also to split up to place one below the other in the virtual viewer
upon a double click of this key,
alters!  Such that I can't just successfully delineate things with simple
static GetTextInRect functions.

So, what I'm wondering, is, what other options might be available to me to
do this?
Now there are what Jaws identifies as, Tabs, sitting between each one, which
I was thinking if I knew how to get functions to do something like this:
take the block of text, then move along till you find the first tab, then
chop that from the left and assign it to a string,
then move along to the next piece of actual text, starting counting from
there, then when you reach the next Tab, chop that out and assign it to some
string, ... etc, I thought I could then achieve this.
But, I've no idea how I might go about doing this? I'm not at all really
adept yet at handling the return values of functions, and feeding them into
new new functions
as parameters upon which the next function acts? Which I'm fairly sure is
what I'm going to be needing to be able to do, in order to achieve this one?

Or, the other thought I had was to maybe delineate by color instead.
All the actual text in the block, is CornFlower blue on Black. i.e, in
integer land,
15765624 on 0.
Whereas the Tabs in between each helper prompt string that I wish to insert
pauses into and be able to deal with individually in virtual viewer,
is the standard Lime Green on Black terminal emulation color. i.e. in
integer land,
3201060 on 0.
Though interestingly, even with Hsc ReadPixel Color command, I'm unable to
find any pixels in my tab identified spot, that report themselves as that
Lime green color, even though JawsKey+top row 5, reports the tab as Lime
Green on black.

Might I be able to utilize something which looked for color instead, to
achieve what I'm after?
What would people suggest might be the bestest approach for this.

Thanks so much for any tips or exemplery code anyone might have time to
throw up at me on this one.

geoff c.



__________
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

Other related posts: