Sign in to follow this  
Followers 0
Falling

How do I get Autoit to select this box and copy

13 posts in this topic

Posted Image

I need to highlight the box as shown in this picture and copy the contents to a variable. For some reason even when it is highlight the Cursor is blinking at another location on the screen.

I have tried these: But the focus does not seem to go to ThunderTextBox26 even though I'm certain that is the box name.

ControlFocus ( "Receive Payment", "", "ThunderTextBox26" )

Send("{LSHIFT}")

Send("{LEFT}")

Send("{LEFT}")

Send("{LEFT}")

Send("{LEFT}")

Also I tried:

MouseClick("left")

MouseClick("left")

--None of these seem to actually focus on the button.they click or do the shifts where the cursor is. Though manually I can highlight the box, as shown in the picture.

The Visible Text field Shows the value I need ...maybe i can just get it from there. Not sure how that would be possible though since there are tons of things int he Visible Text list. Is there a way I can access a element in the list? Like for example:

VisibleText[15] = 15th item in visible Text. that would be a nice function to have. Has anyone every done this?

Window Spy info on button:

>>>>>>>>>>>> Window Title <<<<<<<<<<<<<

Receive Payment

( classname=ThunderFormDC )

>>>>>>>>>>> Window Dimensions <<<<<<<<<<<

left: 8 top: 80 width: 815 height: 547

>>>>>>>>>>> Mouse Position <<<<<<<<<<<

On Desktop: x: 481 y: 174

In Window: x: 473 y: 94

>>>>>>>>>>> Pixel Color Under Mouse (RGB) <<<<<<<<<<<

Hex: 0xFFFFFF Dec: 16777215

(Obselete BGR Mode - Hex: 0xFFFFFF Dec: 16777215)

>>>>>>>>>>> Last Control Under Mouse <<<<<<<<<<<

Class: ThunderTextBox26

Text: 0

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Share this post


Link to post
Share on other sites



Couple things:

ThunderTextBox(es) are normally created using VB, but the boxes are renamed when compiled. This may more may not apply here. If using the compiled application try replacing Thunder6TextBox(INDEX).

It looks like highlight is working so that probably isn't significant. Are you using Highlight to copy or is there another reason you highlight? If highlighting is not important here try ControlGetText (I believe that is the right function) and ClipPut the return of that.

I hope something in here was of use.

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Couple things:

ThunderTextBox(es) are normally created using VB, but the boxes are renamed when compiled. This may more may not apply here. If using the compiled application try replacing Thunder6TextBox(INDEX).

It looks like highlight is working so that probably isn't significant. Are you using Highlight to copy or is there another reason you highlight? If highlighting is not important here try ControlGetText (I believe that is the right function) and ClipPut the return of that.

I hope something in here was of use.

*** Matt @ MPCS

<{POST_SNAPBACK}>

I tried:

sleep(4000)
$a = ControlGetText ( "Receive Payment", "", "Thunder6TextBox(26)" )
MsgBox($a,"Result:", $a)

No soup there. Get "" as the result.

I also tried slugs method but that does not work.

What about that visible text index thing? I'm actually running the program from VB itself if that matters.

-----

Edited by Falling

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Drop the Parents on Thunder6TextBox, I only put them there to distinguish between the name and a number.

Try:

sleep(4000)
$a = ControlGetText ( "Receive Payment", "", "Thunder6TextBox26" )
MsgBox($a,"Result:", $a)

*** Matt @ MPCS

Hold on... while running the application from VB you need to use the name you have. I was just warning you that when you make it into an EXE your script will no longer be valid.

Edited by Matt @ MPCS

Share this post


Link to post
Share on other sites

Cyberslug is on the right path with his. What problem do you run into when you run it that way?

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

In that case it just exits...never even brings up the message box.

I tried your new way and it did not work either.

I'm thinking maybe a way around all of this would be to copy the Visible Text into an array and just access the index i want to use. is autospys code around here Maybe i can read it and figure out how it gets the list of visible text.

Share this post


Link to post
Share on other sites

That would complicate this a lot more than it needs to be. Can you show me the script you used based off CyberSlug's that doesn't work?

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I just copied his exact code. Then i copied yours. then i copied your revision. But none work they either return no message box, or they return a message box with nothing in it.

I think having access to an array of visible text would be awsome personally. Easy to setup variables on the fly from just an index.

When i do the Thunder6TextBox26 it returns a msgbox with nothing.

If i used ThunderTextBox26 nothing happens at all.

So maybe Thunder6TextBox26 is empty? Reguardless Autoit does find the value in Visible Text.

Edited by Falling

Share this post


Link to post
Share on other sites

It would simplify this partially, but how do you suggest it is seperated? By sentence? By Control? There are too many things people want and not enough desire to back it up.

Ok on CyberSlug's code... do this instead (it should work):

$x = ControlGetText("Receive Payment","","ThunderTextBox26")
MsgBox(0,"Result:", $x)

It was passing an illegal parameter to the iconish field...

*** Matt @ MPCS

Share this post


Link to post
Share on other sites

:) I know that SpywareBlaster uses controls such as "ThunderRT6TextBox1" and ControlGetText works with it.

Oops, I just noticed a bug in my posted code. It should be:

$x = ControlGetText("Receive Payment","","ThunderTextBox26")

MsgBox(4096,"Result:", $x)

If you could give focus to the "Print Last Recepit" button, you could try sending "{Tab}" a few times to see if that cycles thru the fields.


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

It would simplify this partially, but how do you suggest it is seperated? By sentence? By Control? There are too many things people want and not enough desire to back it up.

Ok on CyberSlug's code... do this instead (it should work):

$x = ControlGetText("Receive Payment","","ThunderTextBox26")
MsgBox(0,"Result:", $x)

It was passing an illegal parameter to the iconish field...

*** Matt @ MPCS

<{POST_SNAPBACK}>

Yes that works. I thought that the first parametor of msgbox was the title of the msgbox like Inputbox...man fooled me.

The reason why i was woundering how to get the autospy code was to find out how they seperate the list into lines. If they can do it by lines then it must be already in an array or it must be easy to convert into an array.

Share this post


Link to post
Share on other sites

I know SpywareBlaster was written in VB. It doesn't do a whole lot... very simple yet useful application.

I caught your bug for you. 4096 is more than needed though.... 0 works for me.

*** Matt @ MPCS

Share this post


Link to post
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
Sign in to follow this  
Followers 0