Unholy_Pony Posted February 23, 2018 Share Posted February 23, 2018 (edited) Greetings all, I'm trying to use WinGetCaretPos and MouseClick in concert. I *think* this should work, but it doesn't. Any ideas would be much appreciated. ;Below this fills out a field and moves the carat into the position to copy the x/y location SEND("loc{TAB}") ;LOCATION FIELD, I want this to grab the x coord position from the array and put it into the mouseclick below. Local $aCaretPos3 = WinGetCaretPos() local $sVariable1 = $aCaretPos3[0] ;plug the variable into the mouseclick. It changes every instance, so it needs to refresh with loop. _WinWaitActivate("New service work order","") MouseClick("left",$sVariable1,385,1,0) ;rest of script that works great. Working script with carat trials.au3 Edited February 23, 2018 by Unholy_Pony Link to comment Share on other sites More sharing options...
Zedna Posted February 23, 2018 Share Posted February 23, 2018 (edited) WinGetCaretPos() returns position relative to foreground window but MouseClick() has absolute (desktop) position. So you have to get position of your window by WinGetPos() and add your caret's X value to window's X value. Edited February 23, 2018 by Zedna Unholy_Pony 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Unholy_Pony Posted February 24, 2018 Author Share Posted February 24, 2018 Thanks for the response Zedna. Does using Opt('MouseCoordMode',0) change that setting? 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