Jump to content

Clicking Text Strings?


Recommended Posts

The text goes something like

Randomzie This and That

This isnt always the same.

Randomize is always the same, along with That

So im attempting a little snippet of code that will click Randomize, no matter what This says.

I have tried using: MouseClick("Randomize ")

to no avail.

Any help is much appreciated !

edit: yes i used the search button !

Edited by Shonnie
Link to comment
Share on other sites

hmm, I think you need to have another look in the helpfile. lol

MouseClick("button"), is the first parameter, ie. which mouse button to click(left, right, middle, etc.)

If you need to click some text in a window(internet explorer = no), then you should use the ControlGetPos function, to get the position of the text control, and MouseMove/MouseClick that position..

If you supply some additional information on what kind of text, and where it can be found, it's alot easier to help you. :rolleyes:

Edited by FreeFry
Link to comment
Share on other sites

Aha I thought I could play with it a little =D

I looked at ControlGetPos, and I dont understand how I would click the text after getting some info on it

This is much confusing...

Thanks !

Edited by Shonnie
Link to comment
Share on other sites

Hmm, sorry, I forgot about the ControlClick function

This is what it says in the helpfile: "Sends a mouse click command to a given control."

ok, now the parameters is these:

ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] )

"title" is the title of whatever window you're trying to click in - This depends heavily on what WinTitleMatchMode is set to... look up on the function Opt() in the helpfile.

"text" is whatever text that you want to use to identify the window - This depends heavily on what WinTextMatchMode is set to... look up on the function Opt() in the helpfile.

controlid is the id, or classname of the label/text control that you want to click on

button is the button (left, right or middle, etc.)

clicks is how many times you want to click (normaly once)

x, and z is the position IN the control you want to click

basicly you're just interested in the first 3

the controlID(which can also be a control class name) can be found using the AutoIt Window Info tool

and example would be to click in the text area of a notepad window:

Run("notepad.exe")

WinWait("notepad")

ControlClick(&][ÝÓÝY ][ÝË  ][ÝÉ][ÝË    ][ÝÑY]I][ÝÊB

I hope I explained that in an easy-to-understand matter. :rolleyes:

Edit:

Added comments about the Opt() function..

Edited by FreeFry
Link to comment
Share on other sites

All controlls have an ID and a classname afaik. but some controls might be ... weird controls(as in msn messenger).

Edit:

You might wanna explain exactly for what program you want to do this in. :rolleyes:

Edited by FreeFry
Link to comment
Share on other sites

Hmm okay well, with Autoits's window info, theres no Control ID

Is there a way to search for the text and find the co-ords of it and then click there?

I think that would be the easiest way to do it.

Anywho its just Opera / Firefox not a specific program, just a link.

Is there a way to click a secific link on a site withou IE?

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