Jump to content

Can't get text from Window


Moon
 Share

Recommended Posts

I have a window that lets me search a database, in the lower left corner it says:

23.245 entries 50 marked

I wanna get the 23.245 as text. How do I do it if Auinfo does not give any text when I hover over this entry?

TIA!

Link to comment
Share on other sites

It looks good but it does not seem to work properly, maybe cause I', on AutoIt 3.2? I can grab info from the window but the listed items do not contain the "number of entries" I'm looking for. So I tried to copy all to the clipboard to see whether I can get the info from this. Doing so I get the error message:

Error in line 327

Subscript used with non-Array variable.

This happens whether I try to copy all or just some items.

EDIT: I was blind again, the info is there, it reads:

'&Direct Hits (854)'

whereas '854' is the number I'm interested in.

Now when I press the (+) on it I get: TcxTabSheet2

So this is the control handle I gotta read from to get the value '854'? Like

$var = ControlGetText("My Window", "", "TcxTabSheet2")

Sorry, I'm still a bit confused about all of this...

Edited by Moon
Link to comment
Share on other sites

OK, so I've fiddled around with it a bit and used a different window which also displays info from the database but in a more specific way. Using Au3info I've identified the Control ID I'm interested in:

Control ID: 66098

ClassNameNN: TdxStatusBar1

Text:

As you can see the Text field is empty even though the control has the text '854 Entries'.

Thus when I use $num_entries = ControlGetText("My Window", "", 66098) it returns an empty string. Curiously enough this text IS retrievable with the function WinGetText and shown in Au3Info under >>>> Visible Window Text <<<< like this:

Toolbar

&command1

&command2

&command3

on (U)

on (U)

&filter1

category

&direct hits (854)

more hits

sorted by

sorted by

So how can I convert this string returned by WinGetText to '854' (the number may be smaller/larger but it'll always be in brackets), which is all I'm interested in?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...