Jump to content
Sign in to follow this  
Elishac

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

Recommended Posts

Elishac

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.

Share this post


Link to post
Share on other sites
DMEE

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

Share this post


Link to post
Share on other sites
Elishac

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

what does it mean ? I don't know what a control is. Can you be more specific?

Thanks for the clipget() command, i'll look into it.

Share this post


Link to post
Share on other sites
DMEE

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

Share this post


Link to post
Share on other sites
Elishac

Can you please tell me what "Do you know the control in which the number is located?" means ?

What's "the control" ?

Share this post


Link to post
Share on other sites
DMEE

If you post a screenshot of the gui, I can show you


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

Share this post


Link to post
Share on other sites
Elishac

What's a gui ? How to make a screenshot ?

Share this post


Link to post
Share on other sites
DMEE

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

Share this post


Link to post
Share on other sites
Elishac

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 ?

Share this post


Link to post
Share on other sites
DMEE

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

Share this post


Link to post
Share on other sites
Elishac

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

Share this post


Link to post
Share on other sites
DMEE

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

Share this post


Link to post
Share on other sites
Bert

Look at using the IE controls in AutoIt. You will need to read the helpfile to understand them. If you do not understand AutoIt on a basic level, then look at AutoIt 1 2 3 located in the examples script section. It will teach you the basics of AuotIt.

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  

×