Jump to content

How to get a number inside a software and use it in a autoit script


Recommended Posts

Hello,

I am using a software, and there's a number in it. I know the exact coordinates of the number, and the number can be copied (it's a text, it's not a picture).

I'd like to know the best way to get that number and use it in my script.

(for example, I could click on the number twice with my mouse, and then copy paste it, and then make some sort of InputBox in order to paste the string and use the number, but I don't know if this way is the best way).

I hope you have understood me. If not, please say so, so that I can reformulate.

Thanks for your help.

Link to comment
Share on other sites

Do you know the control in which the number is located?

Otherwise the copy to clipboard can be used. The inputbox is not needed, just use ClipGet()

In the beginning there was nothing and then even that exploded - anonymous

Link to comment
Share on other sites

please post a screenshot of the gui in which the number is and the information of the autoit info tool. This makes it easier to help you

edit: typo

Edited by DMEE

In the beginning there was nothing and then even that exploded - anonymous

Link to comment
Share on other sites

What's a gui ? -> graphical user interface; the interface of the program to the user

How to make a screenshot ? -> activate the screen, alt+Print Scrn

In the beginning there was nothing and then even that exploded - anonymous

Link to comment
Share on other sites

I still don't understand how to post a screenshot (I activated the screen, and pressed alt+Print Scrn but nothing happened), nor do i understand completely what is a "graphical user interface".

Can't you try to explain me what "a control" is without me doing all that ?

Link to comment
Share on other sites

The concepts of a gui and a control are explained in the help file -> GUI Reference. If you have any specific questions after reading that, please ask.

You toke the screenshot (to the clipboard), congratulations. To upload: first save the image (open any picture editor and type ctrl-v and then ctrl-s), click insert image in the forum and choose the right location.

In the beginning there was nothing and then even that exploded - anonymous

Link to comment
Share on other sites

Ok, I've done it, I hope it is what you want, as it was hard to do.

The number I want to extract is on the image1.PNG (which should be on a attachment file).

The number can't be modified, but it can be copy/pasted, because, if you click it twice, the number gets selected.

My question is still the same : how to extract that number ?

post-35267-1219746978_thumb.png

post-35267-1219747007_thumb.png

post-35267-1219747015_thumb.png

Link to comment
Share on other sites

There is no simple way to get the text from a webpage, other than copy pasting it. If this was not about a webpage, most probably a control should have been used and the function guictrlread could have been of benefit.

Now the simple method is:

1. empty the clipboard with clipput("")

2. double click at right coordinates with mouseclick("left", x, y, 2)

3. send to clipboard with Send(^c) (put a sleep(100) after this command to ensure that the text is on the clipboard)

4. use $number = clipget() to get the number from the clipboard.

There you have your number extracted

In the beginning there was nothing and then even that exploded - anonymous

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...