JasonTHEchristian Posted August 8, 2012 Share Posted August 8, 2012 Good morning, i am in the process of automating a very repatitve task that is basically nothing but a bunch of mouse clicks and copy and paste's. However in one particular window, i cannot "tab" to the field i need to select, it is also an application that autoIT's window info wont return any information on besides window title and mouse position (encompix). SO...i figured since this particular field is always in the same position in the window, depending on the size and position of the window (multiple users will be using this) i can calculate the position of the field. however i suck at math so i cannot remember how to calculate the coordinates. Here are some sample coordinates if you would like to help. Window position -831x 39y, and window size is 731w x 510h, with this the position of the field i want to simulate a mouse click on -573x, 367y. Any help will be met with gratuitous praise and thanks! Link to comment Share on other sites More sharing options...
jdelaney Posted August 8, 2012 Share Posted August 8, 2012 (edited) I'd suggest changing the MouseCoordMode: AutoItSetOption("MouseCoordMode", 2) that makes all x,y coords relative to the client of the active window (make sure your expected window is active). If not using that option, use WinGetPos, and take out the X,Y, and then figure it out from there edit: you can get the x,y coord relative to the client of the active window through the autoitinfo tool Edited August 8, 2012 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
JasonTHEchristian Posted August 8, 2012 Author Share Posted August 8, 2012 I'll try that, thanks for the super fast response YOU ROCK! Link to comment Share on other sites More sharing options...
JasonTHEchristian Posted August 8, 2012 Author Share Posted August 8, 2012 YES! it worked! THANK YOU SO MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
Spiff59 Posted August 8, 2012 Share Posted August 8, 2012 You'll probably run into issues with users who have different screen resolutions. I don't beleive GUI's are redrawn exactly to scale when changing resolution, so you'll find some attempted button clicks will come out as misses. I think you'll either need to store separate location values for each resolution for each control, or switch to Send()ing characters to navigate around the window. Link to comment Share on other sites More sharing options...
JasonTHEchristian Posted August 8, 2012 Author Share Posted August 8, 2012 I couldnt send character's to navigate, this particular field is only "activated" by a mouse click for whatever reason, but thats a good point about different screen resolutions, i imagine that i could get the window size and then calculate the x,y position from that. Thanks for that point! Link to comment Share on other sites More sharing options...
Spiff59 Posted August 8, 2012 Share Posted August 8, 2012 This thread is similar to yours: JasonTHEchristian 1 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