Jump to content
Shoby

How to run the script in different resolution when we use controlClick coords ?

Recommended Posts

Shoby

Hello Everyone,

I am using Controlclick coords as a workaround to click on the datagrid contents. But wen i use my script in another PC which has less resolution than mine. The action fail to perform due to the difference in ControlClick Coords value.

For sure many of them would ave faced this issue..Anyone has any idea on this issue..

Share this post


Link to post
Share on other sites
Zobengrauzis

 make it so that script detects resolution, and changes the slight coordinates accordingly (@desktopheight, @desktopwidth will help you)

 

Share this post


Link to post
Share on other sites
Shoby

Thanks Zobengrauzis for the reply. 

For example,

 

I am using this command to access a dropdown in my own PC : 

ControlClick("Title","","[NAME:dgvInclusions]","left",1,1444,85)

If I give my script to other user with different resolution than me 

ControlClick("Title","","[NAME:dgvInclusions]","left",1,1108,96)

I am unable to fix this issue..

Can you please explain little bit brief about the @desktop command that can be used in my case to fix the issue..

Share this post


Link to post
Share on other sites
Zobengrauzis

@desktopheigh/width will return you desktop resolution. that you can use to make switch for the coordinates to use. If @desktopheight = 1080 and @desktopwidth = XXXX then $click_x_coordinates = XX and $click_y_coordinates = YY.. got it?

Share this post


Link to post
Share on other sites
Shoby

Ya I got it..

 

But if I give my script to another user who has different resolution..I have to know his resolution and the x, y coordinates...?? Is this wat u mean and put more if loop with desktop height and width conditions...Sorry if I am wrong..

Share this post


Link to post
Share on other sites
Zobengrauzis

Yes indeed. Only universal way, is to get scheme (if there is any) by wich the program makes up the coordinates (maybe its always on the 20% on X axis from desktop width and 10% from Y axis on heigh, just an example). other way could be getting height and width of that particular control, and look for cordinate scheme in itself. 

you can look for pixel search, too a way for universal approach, but can't help you much there, cuz not really familiar with it.

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

×