[jawsscripts] Re: Find Graphic Question

  • From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Tue, 02 Dec 2008 14:01:42 -0500

First of all, since I have been mentioning constants a lot lately, here
are a few more which relate to the FindString and FindGraphics
functions.
; commonly used constants
        S_TOP = 0, ; s INDICATES SEARCH TYPE, for find string, find
graphic, FindColors
        S_BOTTOM = 1,
        s_next = 2,
        s_prior = 4,
        S_RESTRICTED = 1, ; for find string, find graphic,
        S_UNRESTRICTED = 0,

Now to answer your question on restricting a search to a line.

FindString would not do that.  If you specified s_next, the Jaws cursor
would be moved to the next occurrence of the string that you were
looking for.   

If this is what you want to do, you could use stringContains and
Getline together to search for a string of text on the current line.

Consider the following code.

if (StringContains (GetLine (), "search string")) then 
   FindString (GetCurrentWindow (), "Search string", s_next,
s_restricted)
else
   Say ("string was not found", ot_status, false)
endif

Notice that I have not done anything to establish the active cursor or
position the cursor so this would be necessary before running this
code.

The stringContains function will return an integer value for the
starting position of the string that was found in the first parameter,
in this case the contents of GetLine.  If the string does not exist in
the first string, then 0 is returned.

Therefore, if the StringContains function returns a value greater than
0  then the FindString function would be performed.



David Farough
Application Accessibility Coordinator/coordonateur de l'accessibilité 
Information Technology Services Directorate /
Direction des services d'information technologiques
Public Service Commission / Commission de la fonction publique
Email / Courriel:  David.Farough@xxxxxxxxxxxxx
Tel. / Tél:    (613) 992-2779 

>>> "GianniP46" <giannip46@xxxxxxxxxxxxx> 12:34 pm Tuesday, December
02, 2008 >>>
What I was trying to ask last week was, if you could use FindGraphic or

FindString just to search with in one line instead of the whole app or

window.  For example, I would move the jaws cursor to the beginning of
a 
particular line, and then I would want to search for a graphic only on
that 
line.  Is this possible?  Thanks!

__________ 
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: