Well, that's because it may well be present onscreen, i.e., jaws can find it, but it's not visible. I would use isWindowVisible() to check whether or not Jaws actually sees the window onscreen, &, if so, then attempt to set focus to it. On 5/6/12, Steve Matzura <number6@xxxxxxxxxxxxxx> wrote: > I'm scripting an application that has a window that's sometimes there, > sometimes not. The first order of business is to check if the window > is there, and if it is, set focus to it. I know the control ID of the > window, 1019. I'm trying to use FindDescendantWindow with a start > handle of 0 to verify its existence. My script so far looks like this: > > Script ReadSearchStatus () > > var handle hwin > > let hwin = FindDescendantWindow (0, 1019) > > if hwin > 0 > then > Say ("search window present.", ot_jaws_message, false) > > ; Insert code to set focus to the window. Should I even bother > ; with this? > ; Should I just try setting focus and if it fails, assume the window's > ; not present? > > else > Say ("search window is not present.", ot_jaws_message, false) > > endif > > EndScript > > The problem is, it always comes up saying the window is present, even > when it's not. > __________� > > View the list's information and change your settings at > //www.freelists.org/list/jawsscripts > > -- Blame the computer--why not? It can't defend itself & occasionally might even be the culprit Jackie McBride Ask Me Computer Questions at: www.pcinquirer.com Jaws Scripting training materials: www.screenreaderscripting.com homePage: www.abletec.serverheaven.net __________� View the list's information and change your settings at //www.freelists.org/list/jawsscripts