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:

 "BX" <bronx_lab@fltg.net>

Subject:

 Re: text.nextline

Date:

 Sun, Sep 15, 2013 10:49:01 pm
This is a multi-part message in MIME format.

------=_NextPart_000_000D_01CEB265.C549C430
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hi!
Yes, the fact you had moved and resized the screen it came into view. Several pixels is only one char and not capture much if anything before such a move, once out on the boundary.
The pain when having many windows on a screen and they merge.
As chip says, the clip gets the actual data where as the screen point gets what windows wants you to see...

There is a big difference between the 2 ways of getting the data. If I remember correctly a window has the layout and what is there and that is only what windows places there. The clip is the data and the screen is what of that data gets on the screen...

Bruce



Sent: Sunday, September 15, 2013 9:50 PM
Subject: Re: text.nextline


In my case, the lower left reported as being at 55x902 and the first character on the last line was at 61x885. I thought it was probably just that the window rectangle would be just outside this last line. So when And by moving in by 8x15 I consistently found the last line as the window was resized and moved.


Thanks again Chip and Bruce.


Jonatahn


Best wishes,


Jonathan






On Sep 15, 2013, at 9:10 PM, Chip Orange wrote:


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_000D_01CEB265.C549C430
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type><BASE
href="x-msg://162/">
<META name=GENERATOR content="MSHTML 8.00.6001.23520">
<STYLE></STYLE>
</HEAD>
<BODY
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi!</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; Yes, the fact you had moved and
resized the screen it came into view. Several pixels is only one char and not
capture much if anything before such a move, once out on the
boundary.</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; The pain when having many
windows on a screen and they merge.</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; As chip says, the clip gets the
actual data where as the screen point gets what windows wants you to
see...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; There is a big difference
between the 2 ways of getting the data. If I remember correctly a window has the
layout and what is there and that is only what windows places there. The clip is
the data and the screen is what of that data gets on the screen...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
Bruce</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, September 15, 2013 9:50
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: text.nextline</DIV>
<DIV><BR></DIV>In my case, the lower left reported as being at 55x902 and the
first character on the last line was at 61x885. I thought it was probably just
that the window rectangle would be just outside this last line. So when And by
moving in by 8x15 I consistently found the last line as the window was resized
and moved.
<DIV><BR></DIV>
<DIV>Thanks again Chip and Bruce.</DIV>
<DIV><BR></DIV>
<DIV>Jonatahn</DIV>
<DIV><BR>
<DIV><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; COLOR: rgb(0,0,0); WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<DIV>Best wishes,</DIV>
<DIV><BR></DIV>
<DIV>Jonathan</DIV>
<DIV><BR></DIV></DIV></SPAN></SPAN><BR
class=Apple-interchange-newline></DIV><BR>
<DIV>
<DIV>On Sep 15, 2013, at 9:10 PM, Chip Orange wrote:</DIV><BR
class=Apple-interchange-newline>
<BLOCKQUOTE type="cite"><SPAN
style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; BORDER-COLLAPSE: separate; FONT: medium Helvetica; WHITE-SPACE: normal; ORPHANS: 2; LETTER-SPACING: normal; WORD-SPACING: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"
class=Apple-style-span>
<DIV
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"
lang=EN-US vlink="purple" link="blue">
<DIV style="page: WordSection1" class=WordSection1>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Jonathin,<O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">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’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’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’re being returned an empty
string, and then try a second time.&nbsp; 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.<O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Hth,<O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Chip<O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><O:P></O:P></SPAN></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Calibri, sans-serif; COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><O:P></O:P></SPAN></DIV>
<DIV>
<DIV
style="BORDER-BOTTOM-STYLE: none; PADDING-BOTTOM: 0in; BORDER-RIGHT-STYLE: none; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-LEFT-STYLE: none; BORDER-TOP: rgb(181,196,223) 1pt solid; PADDING-TOP: 3pt">
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><B><SPAN
style="FONT-FAMILY: Tahoma, sans-serif; FONT-SIZE: 10pt">From:</SPAN></B><SPAN
style="FONT-FAMILY: Tahoma, sans-serif; FONT-SIZE: 10pt"><SPAN
class=Apple-converted-space>&nbsp;</SPAN>Jonathan Cohn
[mailto:jon.c.cohn@gmail.com]<SPAN
class=Apple-converted-space>&nbsp;</SPAN><B>On Behalf Of<SPAN
class=Apple-converted-space>&nbsp;</SPAN></B>Jonathan C.
Cohn<BR><B>Sent:</B><SPAN class=Apple-converted-space>&nbsp;</SPAN>Sunday,
September 15, 2013 6:15 PM<BR><B>To:</B><SPAN
class=Apple-converted-space>&nbsp;</SPAN><A
href="mailto:gw-scripting@gwmicro.com">gw-scripting@gwmicro.com</A><BR><B>Subject:</B><SPAN
class=Apple-converted-space>&nbsp;</SPAN>Re:
text.nextline<O:P></O:P></SPAN></DIV></DIV></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">Bruce,<O:P></O:P></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">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></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><O:P></O:P></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt">&nbsp;&nbsp;<O:P></O:P></DIV>
<DIV>
<DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Helvetica, sans-serif; COLOR: black; FONT-SIZE: 13.5pt">Best
wishes,<O:P></O:P></SPAN></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Helvetica, sans-serif; COLOR: black; FONT-SIZE: 13.5pt"><O:P></O:P></SPAN></DIV></DIV>
<DIV>
<DIV
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"><SPAN
style="FONT-FAMILY: Helvetica, sans-serif; COLOR: black; FONT-SIZE: 13.5pt">Jonathan<O:P></O:P></SPAN></DIV></DIV>
<DIV>
<P
style="MARGIN: 0in 0in 0pt; FONT-FAMILY: 'Times New Roman', serif; FONT-SIZE: 12pt"
class=MsoNormal><SPAN
style="FONT-FAMILY: Helvetica, sans-serif; COLOR: black; FONT-SIZE: 13.5pt"></SPAN></P></DIV></DIV></DIV></DIV></DIV></DIV></SPAN></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000D_01CEB265.C549C430--