HiChip:
The window.type property did not show the edit boxes in Internet
Explorer or Firefox.
It showed all the controls as "custom controls".
I then tried Chip's suggestion of using the Accessible property of the
Browsemodeline object, but I must be doing something wrong because
when I created my accessible object from my browsemodeline object, and
then tried to speak its name, it gave me an error.
The relavent code follows:
dim OBrowseLines 'a BrowseModeLines object
dim OBrowseLine 'a BrowseModeLine object
dim Icount 'number of BrowseModeLine objects in the
BrowseModeLines
object that was created.
dim ICounter 'loop counter
Dim ILink 'number of links on the page
set OBrowseLines = BrowseMode.Lines 'creating the
BrowseModeLines
object from the BrowseMode object
dim OAccess 'accessible object derived from the BrowseLine
object
Icount = OBrowseLines.count
ILink = 0
'now create the BrowseModeLine objects and find out the number
of
links on a webpage
for ICounter = 1 to ICount
set OBrowseLine = OBrowseLines.Item(Icounter)
set OAccess = OBrowseLine.Accessible 'the accessible
object
speak OAccess.name
Next
Kevin Huber
On 7/9/12, Chip Orange <[email protected]> wrote:
> Hi Kevin,
>
> Normally, you would use the window.type property to identify an editbox
> control. I don't know if this works well in a browser window though.
>
> One thing which occurs to me is that this way, you will only be able to
> find
> the editbox controls which are currently in view on the window; maybe this
> isn't a problem for what you're doing.
>
> The other way I'd look at would be to use the accessible property of the
> browsemodeLine object, maybe you could identify editboxes that way, and if
> they had focus? Also, the window object probably has an accessible object
> which might tell you if it has focus. Sorry I just don't have time at the
> moment to dig around.
>
> hth,
>
> Chip
>
>
>
>> -----Original Message-----
>> From: Kevin Huber [mailto:[email protected]]
>> Sent: Monday, July 09, 2012 3:47 PM
>> To: [email protected]
>> Subject: Re: script to automatically turn off Browse mode in
>> edit boxes
>>
>> Hi Chip:
>> I was able to count the links on a page using code which was
>> similar to the snipit.
>> Now, the question is, how can I identify controls such as
>> edit boxes and combo boxes etc on that page.
>> I decided to try using the Windows object to do this as follows:
>> Dim OWindow:set OWindow = Activewindow.children
>> ' Window objects derived from the Windows object
>> dim ICount 'number of children in the Windows object
>> dim Icounter 'loop counter
>> Icount = OWindow.count
>> For ICounter = 41 to icount
>> if OWindow(Icounter).Visible then
>> Speak ICounter
>> Speak OWindow(ICounter).title
>> End If
>> Next
>>
>> I ran a test script containing this code on a page in
>> Internet Explorer and found some titles which sounded
>> promising, but I am not sure if I am using the right property
>> of the Window object to identify an Edit box.
>> The second question is, once I am able to identify these edit
>> boxes, is there a way to identify if it has focus, I.E. if
>> the Virtual Cursor is pointing to it?
>> Kevin Huber
>>
>> On 7/3/12, Chip Orange <[email protected]> wrote:
>> > Hi Kevin,
>> >
>> > You're on the right track; the only thing misleading you is
>> the name
>> > "browsemode lines"; it's not always a line you get as one of the
>> > members of this collection; if it's a link, then the link will be a
>> > member. If a given line has 10 links, then you'll get 10
>> more members
>> > of the collection just for the links of that one line.
>> >
>> > You were close to finding the links also, it's not because
>> you weren't
>> > in browsemode (you're always in browsemode by default when
>> you open a
>> > page), it's just that you were unlucky in your guesses.
>> >
>> >
>> > Below is a code snipit I used in Immed to find the links of the
>> > current page; I typed this in in the single line mode, although it
>> > would be easier to do it in the multiline mode:
>> >
>> > for each x in browsemode.lines: if x.isLink then print
>> x.index : end if:
>> > next
>> >
>> > I got a list of the indexes of each of the links in the collection.
>> >
>> > hth,
>> >
>> > Chip
>> >
>> >
>> >> -----Original Message-----
>> >> From: Kevin Huber [mailto:[email protected]]
>> >> Sent: Friday, June 29, 2012 4:28 PM
>> >> To: [email protected]
>> >> Subject: Re: script to automatically turn off Browse mode in edit
>> >> boxes
>> >>
>> >> Hi:
>> >> I was just playing with the BrowseMode, BrowseModeLines and
>> >> BrowseModeLine objects to see if I could get what I want from the
>> >> BrowseModeLine object, since some of the properties of that object
>> >> are "IsLink", "IsQuote" and a few other similar ones. But I have
>> >> some questions.
>> >> First, I opened Internet Explorer and opened the Immed window and
>> >> wrote the following code without the quotes:
>> >>
>> >> "set MyBrowseMode = BrowseMode.Lines"
>> >>
>> >> where MyBrowseMode is a BrowseModeLines object 'then I typed the
>> >> following"
>> >>
>> >> "speak MyBrowseMode.Count"
>> >>
>> >> The resulting number was 101. but when I manually counted
>> the lines
>> >> on the page, the number that I got was far less.
>> >> So what does that mean?
>> >> Then I went further and typed the following code
>> >>
>> >> "set MyIndex = MyBrowsMode.Item(50)"
>> >>
>> >> where MyIndex is a BrowseModeLine object.
>> >> Then I typed:
>> >>
>> >> "speak MyIndex.islink"
>> >>
>> >> and the value I got back was "false.
>> >> I tried changing the index in the line above to creat different
>> >> BrowseModeLine objects and I tried speaking several diferent
>> >> properties of the resulting BrowseModeLine objects and all of the
>> >> results were false.
>> >> I am not sure what these indexes such as mybrowsmode.item(1),
>> >> mybrowsemode.item(2) etc represent, since they don't appear to
>> >> represent the lines on the page.
>> >>
>> >> Sorry for the longwindedness, but I don't know how else to
>> explain my
>> >> confussion.
>> >> Kevin Huber
>> >>
>> >>
>> >> On 6/29/12, BT <[email protected]> wrote:
>> >> > Hi Kevin,
>> >> >
>> >> > Yes maybe less code but not really since either case
>> is just a
>> >> > simple call, such as execute hotkey...
>> >> >
>> >> > I was trying to find the information that gives the names of
>> >> > controls but could not find any. All it does is spit out
>> >> the name such
>> >> > as Edit Box and gives you no code value for it. I tried
>> >> using the role
>> >> > value but edit boxs are ignored, along with many other
>> controls...
>> >> >
>> >> > Sincerely
>> >> > Bruce
>> >> >
>> >> > To: <[email protected]>
>> >> > Sent: Friday, June 29, 2012 1:02 PM
>> >> > Subject: Re: script to automatically turn off Browse
>> mode in edit
>> >> > boxes
>> >> >
>> >> >
>> >> > Hi Bruce:
>> >> > I just tested the ActiveSettings.General.Browsemode and you
>> >> can turn
>> >> > it on and of, thus you wouldn't have to fire the hotkey.
>> >> > I think I would have to write less code, although I
>> could be wrong.
>> >> > Kevin Huber
>> >> >
>> >> >
>> >> > On 6/29/12, Kevin Huber <[email protected]> wrote:
>> >> >> Hi Bruce:
>> >> >> That makes sense. I was thinking along those lines too,
>> >> but is there
>> >> >> an object that I can use to monitor those controls?
>> >> >> Kevin Huber
>> >> >> On 6/25/12, BT <[email protected]> wrote:
>> >> >>>
>> >> >>> Hi!
>> >> >>>
>> >> >>> Control-Shift-A already does this as long as you
>> are on the
>> >> >>> control or edit box.
>> >> >>>
>> >> >>> I think JAWS has this feature and automatically
>> turns it off
>> >> >>> when on an
>> >> >>>
>> >> >>> edit box. It is a nice idea but one way or another a
>> toggle would
>> >> >>> have to be
>> >> >>>
>> >> >>> used to get you back out of the edit box afterwards, but
>> >> this would
>> >> >>> at least
>> >> >>>
>> >> >>> cut down to one key-combo stroke instead of 2.
>> >> >>>
>> >> >>> One could monitor your controls and fire the
>> hotkey for the
>> >> >>> control-shift-A and it would be an easy app to have. Just
>> >> look for
>> >> >>> edit boxes or set it for what control you want it to
>> >> activate on and
>> >> >>> that should
>> >> >>>
>> >> >>> be it.
>> >> >>> I could monitor my Ribbon_Read app to do this since
>> >> it reads all
>> >> >>> controls and you could activate any kind of control you
>> >> want it to
>> >> >>> toggle for you. I gave a copy of this to the one that wanted
>> >> >>> TextPad to read better...
>> >> >>>
>> >> >>> Bruce
>> >> >>>
>> >> >>> Bruce
>> >> >>>
>> >> >>> Sent: Monday, June 25, 2012 2:25 PM
>> >> >>> Subject: Re: script to automatically turn off Browse
>> mode in edit
>> >> >>> boxes
>> >> >>>
>> >> >>>
>> >> >>> Kevin
>> >> >>>
>> >> >>> A toggle key, to activate or deactivate, would make great
>> >> sense with
>> >> >>> this idea . Additionally, I'd suggest allowing the user
>> >> to select
>> >> >>> his preferred default.
>> >> >>> In my use, I suspect, I would probably opt to have the
>> >> boxes act as
>> >> >>> they now do but only to open up after the toggle.
>> >> >>> I tend to read pages with the arrow keys so having browse
>> >> mode act
>> >> >>> as it now does is my preferred style unless I actually
>> wanted to
>> >> >>> fill out something.
>> >> >>>
>> >> >>> Good luck with the idea.
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>> Bible study has torn my life apart and remade it. That
>> is to say
>> >> >>> that God, through his Word, has done so.
>> >> >>> -- Derek Tidball, author of "The Message of
>> Holiness: Restoring
>> >> >>> God's Masterpiece"
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>>
>> >> >>
>> >> >
>> >> >
>> >>
>> >
>> >
>>
>
>