cmpyutr Posted July 24, 2012 Share Posted July 24, 2012 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. Link to comment Share on other sites More sharing options...
water Posted July 24, 2012 Share Posted July 24, 2012 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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
cmpyutr Posted July 24, 2012 Author Share Posted July 24, 2012 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. Link to comment Share on other sites More sharing options...
water Posted July 24, 2012 Share Posted July 24, 2012 #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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now