[jawsscripts] Re: Element attribute values.

  • From: "L�onie Watson" <tink@xxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sun, 3 May 2009 22:17:48 +0100

        Thanks for your help Chad, this has really kick started things. As
Haden suggested, I've posted the code for my first script below.
It's now working, although I'm sure it's a bit rough around the edges!

;Jaws 10 script for Internet Explorer 8 on Windows XP.
;Written by Léonie Watson, May 2009.
;Script appended to Control l key command.

Script MoveToNextAccessibilityLink ()
var
string AttributeValueString,
string LinkDescription

let AttributeValueString = "rel=accessibility"
MoveToTagWithAttribute (S_NEXT, "a", "rel", true)
let LinkDescription = GetElementDescription (0, false)

while !StringContains (LinkDescription, AttributeValueString)
        MoveToTagWithAttribute (S_NEXT, "a", "rel", true)
        let LinkDescription = GetElementDescription (0, false)
EndWhile

if StringContains (LinkDescription, AttributeValueString) then
        SaySelectedLink4 ()
EndIf
EndScript

        I've tested this out with a dummy page using the following html
code:

<p>
<a href="page1.html">Page One</a>
<br />

<a href="page2.html">Page Two</a>
<br />

<a href="page3.html" rel="gallery">Page Three</a>
<br />

<a href="page4.html">Page Four</a>
<br />

<a href="page5.html" rel="accessibility">Page Five</a>
<br />

<a href="page6.html"> Page Six</a>
<br />

<a href="page7.html" rel="donut">Page Seven</a>
<br />

<a href="page8.html" rel="accessibility">Page Eight</a>
<br />

<a href="page9.html" rel="accessibility">Page Nine</a>
<br />

<a href="page10.html" rel=accessibility">Page Ten</a>

        If you have any feedback on the above, it would be very welcome.
Otherwise, next stop is to make the reverse navigation script using the
Shift key modifier.

        This does lead me to another question though. I've added the above
script to the InternetExplorer.jss/jkm files. What would be the best
approach of making this script available to other people to test on other
platforms and browsers, and ultimately for people to use once it's been
tested? Thanks.


Léonie.
--
http://www.tink.co.uk/

Email: tink@xxxxxxxxxx
Twitter: LeonieWatson

-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx
[mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of Chad Foster
Sent: 03 May 2009 21:14
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Re: Element attribute values.

Léonie - check out the GetElementDescription function. You can use it in
conjunction with the StringContains function to achieve what you need. Also,
you can use MoveToTagWithAttribute to accomplish the same thing.


HTH,

Chad


On 5/3/09, Léonie Watson <tink@xxxxxxxxxx> wrote:
> Good evening,
>
>       I'm returning to Jaws scripting after a bit of a break. I've
> refreshed my memory on the basics, and feel pretty comfortable with things
at that level.
>
>       I'm now trying to write a script that will allow me to identify all
> the links on a page with a specific attribute. The catch is that I
> also need to be able to identify a specific value for that attribute.
> I'd then like to be able to move between the links that have this
> specific attribute/value combination.
>
>       I've started with a script that will move to the next link on the
> page with the given attribute/value combination. The
> MoveToTagWithAttribute() function successfully gets me part of the
> way, but I'm struggling with a method for getting at the attribute value
information.
>
>       I've used the DisplayBasicElementInfo() function, which provides
just
> the kind of information I need on the element. The trouble is that I
> don't want it to appear in the virtual reader, but instead would like
> to be able to access it to determine if the element has the right
> attribute/value combination.
>
>       It's quite possible of course that I'm taking entirely the wrong
approach!
> If
> anyone can help, make any suggestions or point me in the direction of
> some further reading/resources, I'd be grateful. At the moment, this
> is making me dizzy! Thanks.
>
> Léonie.
>
>
> --
> http://www.tink.co.uk/
>
> Email: tink@xxxxxxxxxx
> Twitter: LeonieWatson
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4049 (20090501) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>
> __________
> Visit and contribute to The JAWS Script Repository
> http://jawsscripts.com
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
>
>


--
Chad Foster
Access Technology Solutions
Leveling The Playing Field Through Technology http://www.GO-ATS.net
__________ Visit and contribute to The JAWS Script Repository
http://jawsscripts.com

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



__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4050 (20090503) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com



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

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

Other related posts: