[jawsscripts] Re: Finding and clicking the string from the desired window.

  • From: Jitendra <jeet.invincible@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Thu, 06 Aug 2009 17:24:57 +0530

Ok, thanks and btw, you are correct, there should be another separator, 
as sometimes, there is a string "click me", and in that case where space 
is used, those will come as 2 different items in the list, but clicking 
any of them would make the same thing.
it seems that the code you have given is from the band in a box scripts, 
if yes, I have them and can see the header file as well, and if not, 
where you declared those variables found in the code?
what are you talking about, the function "GetListOfObjects?
Thank you, Jitendra.
You wrote:
Space is not a great separator, Jitendra. The reason is that if u have
a string "click me", it's 2 words, & u don't wanna click the word me.
Try to find another separator, e.g, newline, tab, etc.

When I can, I try to use a list of object names rather than strings.

However, here is some code that might do similarly to what u want.
Note that separator has been defined in the header file as "\007"
Basically it walks the window, collecting the list of the desired
items, & then displaying them in a list.

Void Function FindButtons (string track)

var
handle wh,
handle HTrack,
string windowname,
string list,
string SelectedItem,
int item

let windowname = track + " Track"
if (StringContains(GetWindowName(GetRealWindow(GetCurrentwindow())),
"DirectX Plugins")) then
;in synth settings dialog, 1st combo is to select synth
let wh = FindWindow(GetTopLevelWindow(GetCurrentWindow()), "", windowname)
if (wh) then ;wh
let HTrack = wh
MoveToWindow(wh)
LeftMouseButton()       
let wh = GetFirstChild(wh)
let wh = GetLastWindow(wh)

while (wh && !IsKeyWaiting ())
let wh = GetPriorWindow(wh)
pause()
if (GetWindowSubtypeCode(wh) == wt_button) then ;button
let list = list + GetWindowName(wh)+separator
endif ;button
endWhile
PcCursor()
let item = DlgSelectItemInList (list, "Synth Settings Dialog", 0, 1)
let selectedItem = StringSegment(list, separator, item)
let wh = FindWindow(HTrack, wcButton, selectedItem)
if (wh) then ;handle of the button was found?
MoveToWindow(wh)
LeftMouseButton()
endif ;handle of the button was found?

endif ;window was found, we're in synth settings
else ;not in synth dialog, whole thing is invalid
say(msgErr4, ot_message)
endif;synth dialog
PcCursor()
return
EndFunction

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