Sign in to follow this  
Followers 0
cmpyutr

mouseclick location changes with screen resolution

4 posts in this topic

Are there some good tips about how to keep the mouseclick in the same place when the screen resolution changes? I write a program for my pc, but the mouseclicks are off when I run the program on my laptop. For example, automating the google preferences, where I say I want 100 items to display, and then I save the preferences.

Here's my code snippet, where I click on the "save" button, and then click on the modal dialog box to dismiss it.

oautoit.mousemove 918,839 'save

oautoit.mouseclick "left"

oautoit.mousemove 937,585 'modal

oautoit.mouseclick "left"

Works perfect on my pc, but is way off when I run the program on my laptop.

Share this post


Link to post
Share on other sites



Best way to make your script independant of screen resolution is to use Controls when working with a GUI or the UDFs for IE, Firefox etc. when working with browsers.

MouseMove and MouseClick is far from being reliable.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Yes, thank you. So I should be using User Defined Functions (UDF's) for IE. Yes, I would love you, because definitely MouseMove and MouseClick make my code completely not transportable. Would it be extremely difficult for you to write code that navigates to http://www.google.com/preferences and then clicks on the "Save" button, so I could get a jump start?

Thank you.

Share this post


Link to post
Share on other sites

#include <ie.au3>
_IECreate("[url="http://www.google.com/preferences"]http://www.google.com/preferences[/url]")
should open the site.

Use _IEFormElementSetValue to enter your values into a form. And _IEAction with function "click" to click on the save button.

This is completely untested but should give you an idea where to start.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  
Followers 0