Jump to content
Sign in to follow this  
Rohith

Text coordinates within the control

Recommended Posts

Rohith

Hello All,

I am a newbee to AutoIT and found it very interesting. I was trying to use this tool and automate few tasks. I am able to perform most of the task except a few.

Problem1 : I have a control where I need to get the text location and click on that text with in the specified control. Is there a function where I can get the text location(x1,y1 and x2,y2 values of pixels) with in the specified Control and perform the click action on the required pixel?

Problem2 : For the ControlTreeView, we do nto have an option for right clicking the mouse on the required Item as we have a contextual menu to the Item. Is there any work around for the same?

Edited by Rohith

Share this post


Link to post
Share on other sites
Fi0da

If the location of the text is always in the same place on the screen, you can use the tool AutoItWindow in "Extras" to obtain the coordinator of the table and so use the MouseClick command.

But if the text message appears as a randomly like a drop item, I think that should determine the color of the letter and use the PixelSearch.

If your problem is not that, wait a few minutes we have some very good guys who always help the students :D


I read ... I update ... I learn ...

Share this post


Link to post
Share on other sites
Rohith

Thanks for the prompt reply FiOda :D.

Yes, the texts which is search for varies in its position and other thing i need to take care is that it runs smooth on other computers also (as the monitor sizes changes). So, it would be better if I can get the position of the required text during run time and click on the same.

Share this post


Link to post
Share on other sites
Richard Robertson

As for trying to right click something, that should always open a context menu. Right clicking isn't meant for general use.

Share this post


Link to post
Share on other sites
Rohith

OH... OK.. i understand. Is there a way to open this contextual menu?

Share this post


Link to post
Share on other sites
Richard Robertson

Simulating a right click is the most direct way to do it. You could instead read the control's information and find its context menu data and display the menu manually. I find that solution to be much more complicated though.

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  

×