The GW-Scripting list is a discussion list for information regarding the development and use of Window-Eyes scripts. Any subscriber of the GW-Scripting list has the ability to post on-topic messages.

From:

 "Chip Orange" <lists3717@comcast.net>

Subject:

 RE: text.nextline

Date:

 Sun, Sep 15, 2013 9:10:56 pm
This is a multipart message in MIME format.

------=_NextPart_000_0017_01CEB258.12158730
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Jonathin,



I too have had some issues with the accuracy of the text object as it
relates to text returned for a given location. I reported these issues to
GW some time back, and as I recall, it was related to converting from
windows to screen coordinates. In my app I wanted to get the text of the
current line as indicated by the cursor, and something was forcing me to go
through these conversion between units, and I was finding that sometimes the
text object would return an empty line, and I'd have to go up/down by a
pixel or two (after the conversion) before it would return the text of the
current line. As I mention in class 15, it's not an entirely reliable way
to retrieve text; you can often do better using the clips collection. But
if text is what you really need, do try adjusting your position up or down
by just a pixel if you're being returned an empty string, and then try a
second time. This is what I eventually had to do in the "Word Advanced
Features" app in order to get text to give me the text of the current line.



Hth,



Chip





From: Jonathan Cohn [mailto:jon.c.cohn@gmail.com] On Behalf Of Jonathan C.
Cohn
Sent: Sunday, September 15, 2013 6:15 PM
To: gw-scripting@gwmicro.com
Subject: Re: text.nextline



Bruce,



Thanks for the class notes from Chip, everybody does have access to these
via the GWMicro web site, though I do appreciate the research efforts.



I was attempting to re-do some examples from jaws training to show to my
co-workers. One of the the labs moves the jaws cursor to the bottom of the
current window and then speaks the information.



I was able to do this fairly easily, but then realized that with the text
object I should be able to get data from any line on the screen without
moving either the mouse or we-cursor.



I got the outline windows rectangle converted that to a screen rectangle and
then asked for the line of text starting at the bottom right of the window.



I was finding that the function was recovering the line just below and to
the left of the current window. I had to remember learn that I needed a
copy of the text object.



I was not able to determine a good method to move just inside of the
outlines edge and just changed my starting point by 20 pixels vertically. I
was hoping that the text.priorline would work but had no success there.





Best wishes,



Jonathan




------=_NextPart_000_0017_01CEB258.12158730
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"; xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><base href="x-msg://162/"><style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-style-span
{mso-style-name:apple-style-span;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Jonathin,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I too have had some issues with the accuracy of the text object as it relates to text returned for a given location.&nbsp; I reported these issues to GW some time back, and as I recall, it was related to converting from windows to screen coordinates.&nbsp; In my app I wanted to get the text of the current line as indicated by the cursor, and something was forcing me to go through these conversion between units, and I was finding that sometimes the text object would return an empty line, and I&#8217;d have to go up/down by a pixel or two (after the conversion) before it would return the text of the current line.&nbsp; As I mention in class 15, it&#8217;s not an entirely reliable way to retrieve text; you can often do better using the clips collection.&nbsp; But if text is what you really need, do try adjusting your position up or down by just a pixel if you&#8217;re being returned an empty string, and then try a second time.&nbsp; This is what I eventually had to do in the &#8220;Word Advanced Features&#8221; app in order to get text to give me the text of the current line.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hth,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Chip<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Jonathan Cohn [mailto:jon.c.cohn@gmail.com] <b>On Behalf Of </b>Jonathan C. Cohn<br><b>Sent:</b> Sunday, September 15, 2013 6:15 PM<br><b>To:</b> gw-scripting@gwmicro.com<br><b>Subject:</b> Re: text.nextline<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Bruce,<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks for the class notes from Chip, everybody does have access to these via the GWMicro web site, though I do appreciate the research efforts.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I was attempting to re-do some examples from jaws training to show to my co-workers. One of the the labs moves the jaws cursor to the bottom of the current window and then speaks the information.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I was able to do this fairly easily, but then realized that with the text object I should be able to get data from any line on the screen without moving either the mouse or we-cursor.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I got the outline windows rectangle converted that to a screen rectangle and then asked for the line of text starting at the bottom right of the window.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I was finding that the function was recovering the line just below and to the left of the current window. I had to remember &nbsp;learn that I needed a copy of the text object.&nbsp;<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>I was not able to determine a good method to move just inside of the outlines edge and just changed my starting point by 20 pixels vertically. I was hoping that the text.priorline would work but had no success there.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>&nbsp;&nbsp; <o:p></o:p></p><div><div><div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'>Best wishes,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p>&nbsp;</o:p></span></p></div><div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'>Jonathan<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black'><o:p>&nbsp;</o:p></span></p></div></div></div></div></div></body></html>
------=_NextPart_000_0017_01CEB258.12158730--